Repository navigation
Expand file tree
/
Copy pathwebpack.config.js
More file actions
57 lines (54 loc) · 1.41 KB
/
Copy pathwebpack.config.js
File metadata and controls
57 lines (54 loc) · 1.41 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
var CopyWebpackPlugin = require('copy-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
const ENV = process.env.ENV = process.env.NODE_ENV = 'development';
const METADATA = {
host: 'localhost',
port: 5067,
ENV: ENV
};
module.exports = {
entry: './src/js/app.js',
output: {
filename: './dist/js/app.js'
},
watch: true,
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'stage-0'],
"plugins": ["transform-class-properties"]
}
},
{
test: /\.sass$/i,
loader: ExtractTextPlugin.extract("style", "raw!sass")
}
]
},
devServer: {
port: METADATA.port,
host: METADATA.host,
historyApiFallback: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000
},
outputPath: './dist'
},
plugins: [
new CopyWebpackPlugin([
{ from: 'src/files/', to: 'dist/files' },
{ from: 'src/images/', to: 'dist/images' }
], {
copyUnmodified: true
}),
new ExtractTextPlugin("dist/css/style.min.css")
],
resolve: {
extensions: ['', '.js', '.es6']
}
};