babeljs - Babel does not transpile code when using Webpack's resolve modules -
or seems,
the code transpiles if use regular relative paths, when use resolve.modules
error message:
you may need appropriate loader handle file type. | export default class test { | | name = 'joe'; | | constructor() { ...
webpack.config:
... resolve: { modules: [ path.resolve(__dirname,'resources/assets/app'), path.resolve('./node_modules') ], }, module: { ...
app/core/test.js:
export default class test { name = 'joe'; constructor() { console.log('construct test'); } }
usage:
import test 'core/test';
does know if bug or missing something?
i same error when using resolve.alias
have tried using babel-plugin-transform-class-properties
.babelrc
{ "presets": [ "es2015", "stage-0", "react" ], "plugins": [ "babel-plugin-transform-class-properties", "react-hot-loader/babel", "transform-async-to-generator", "transform-decorators-legacy" ] }
Comments
Post a Comment