or so it seems,
The code transpiles if I use regular relative paths, but when I use resolve.modules
I get this error message:
You may need an appropriate loader to handle this 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 a Test');
}
}
Usage:
import Test from 'core/Test';
Does anyone know if this is a bug or am I missing something?
I get the same error when using resolve.alias
Have also 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"
]
}