-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
71 lines (70 loc) · 1.44 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
var path = require('path');
var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
context: __dirname + '/src',
entry: {
app: './jsx/main.jsx',
},
output: {
path: path.join(__dirname, 'build'),
filename: 'js/[name].js',
},
resolve: {
extensions: ['', '.js', '.jsx'],
modulesDirectories: ['src/jsx', 'node_modules'],
root: [path.resolve('./src')],
alias: {},
},
devServer: {
// host: '192.168.1.101',
port: 8080,
historyApiFallback: true,
},
module: {
loaders: [
/*
{
test: /\.jsx?$/,
enforce: 'pre',
loader: 'eslint-loader',
options: {
emitWarning: true,
},
},*/
{
exclude: /node_modules/,
test: /\.jsx?$/,
loader: 'babel',
},
{
test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.ttf$|\.eot$|\.wav$|\.mp3$|\.tsv$|\.csv$|\.txt$|\.json$/,
loader: 'file?name=[name]-[hash:6].[ext]',
},
{
test: /\.html$/,
loader:
'file?name=[name].[ext]!extract-loader!html?interpolate=require',
},
{
test: /\.css$/,
loaders: ['style?name=[name]-[hash:6].[ext]', 'css'],
},
{
test: /\.sass$/,
loaders: [
'style?name=[name]-[hash:6].[ext]',
'css',
'sass?indentedSyntax',
],
},
],
},
// context: path.join(__dirname, 'build'),
plugins: [
new webpack.EnvironmentPlugin('NODE_ENV'),
new CopyWebpackPlugin([{ from: 'data/', to: 'data/' }], {
debug: true,
}),
],
};