Created
June 13, 2019 09:32
-
-
Save Alecto/d2a41586a5018edc6a2e9879ade606a4 to your computer and use it in GitHub Desktop.
Настройки для Webpack
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
let path = require('path'); | |
let conf = { | |
entry: './assets/js/main.js', | |
output: { | |
path: path.resolve(__dirname, './assets/js'), | |
filename: 'all.min.js', | |
publicPath: 'assets/js/' | |
}, | |
devServer: {overlay: true}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
loader: 'babel-loader', | |
exclude: '/node_modules/' | |
} | |
] | |
} | |
}; | |
module.exports = (env, options) => { | |
conf.devtool = options.mode === 'production' ? | |
false : | |
'cheap-module-eval-source-map'; | |
return conf; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment