-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
41 lines (40 loc) · 961 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Created by kurpav on 1/21/16.
*/
var path = require("path");
var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: "./app/src/js/index.js",
output: {
path: __dirname,
filename: "./app/dist/js/app.js"
},
module: {
loaders: [
{
loader: "babel-loader",
test: path.join(__dirname, "app/src/js"),
query: {
presets: "es2015"
}
}
]
},
plugins: [
// Avoid publishing files when compilation fails
new webpack.NoErrorsPlugin(),
new CopyWebpackPlugin([
// Copy directory contents to {output}/to/directory/
{ from: './app/src/css', to: 'app/dist/css' },
{ from: './app/src/config', to: 'app/dist/config' },
{ from: './app/src/assets', to: 'app/dist/assets' },
{ from: './app/src/js/lib', to: 'app/dist/js' }])
],
stats: {
// Nice colored output
colors: true
},
// Create Sourcemaps for the bundle
devtool: "source-map"
};