Last active
November 29, 2017 10:03
-
-
Save ara-ta3/dd980bb3e014659339bf3739ff939e05 to your computer and use it in GitHub Desktop.
Error on webpack with babel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/a-tanaka/.nodebrew/current/bin/npm run webpack -- --config ./webpack.config.js | |
> webpack-hello@1.0.0 webpack /Users/a-tanaka/booster | |
> webpack --watch "--config" "./webpack.config.js" | |
Webpack is watching the files… | |
Hash: 4f6ee5333597035827a3 | |
Version: webpack 3.8.1 | |
Time: 48ms | |
ERROR in Entry module not found: Error: Can't resolve 'babel' in '/Users/a-tanaka/booster' | |
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders. | |
You need to specify 'babel-loader' instead of 'babel', | |
see https://webpack.js.org/guides/migrating/#automatic-loader-module-name-extension-removed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hoge {} | |
console.log(new Hoge()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NPM=$(shell which npm) | |
install: $(NPM) | |
$(NPM) install | |
webpack: $(NPM) | |
$(NPM) run webpack -- --config ./webpack.config.js | |
webpack/correct: $(NPM) | |
$(NPM) run webpack -- --config ./webpack.config.corrent.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "webpack-hello", | |
"version": "1.0.0", | |
"description": "hello world with webpack", | |
"main": "index.js", | |
"scripts": { | |
"webpack": "webpack --watch" | |
}, | |
"author": "", | |
"license": "MIT", | |
"dependencies": { | |
"babel-core": "^6.26.0", | |
"babel-loader": "^7.1.2", | |
"babel-preset-es2015": "^6.24.1", | |
"webpack": "3.8.1" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: { | |
main :__dirname + "/main.js", | |
}, | |
output: { | |
path: __dirname + '/dist/', | |
filename: '[name].bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
loader: 'babel-loader' | |
} | |
] | |
}, | |
resolve: { | |
extensions: ['*', '.js'] | |
} | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: { | |
main :__dirname + "/main.js", | |
}, | |
output: { | |
path: __dirname + '/dist/', | |
filename: '[name].bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
loader: 'babel' | |
} | |
] | |
}, | |
resolve: { | |
extensions: ['*', '.js'] | |
} | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment