-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
60 lines (59 loc) · 1.88 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
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
devtool: 'source-map',
entry: {
'app': ['./web/static/css/app.scss', './web/static/js/app.js']
},
output: {
path: './priv/static',
filename: '/js/app.js'
},
resolve: {
moduleDirectories: [__dirname + '/web/static/js'],
alias: {
phoenix: __dirname + '/deps/phoenix/web/static/js/phoenix.js',
containers: __dirname + '/web/static/js/containers',
routes: __dirname + '/web/static/js/containers',
projects: __dirname + '/web/static/js/projects',
styles: __dirname + '/web/static/css',
components: __dirname + '/web/static/js/components',
layouts: __dirname + '/web/static/js/layouts',
views: __dirname + '/web/static/js/views',
actions: __dirname + '/web/static/js/redux/modules'
}
},
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel'
}, {
test: /\.css$/,
loader: ExtractTextPlugin.extract('style', 'css')
}, {
test: /\.scss$/,
loader: ExtractTextPlugin.extract(
'style',
'css!sass?includePaths[]=' + __dirname + '/web/static/css'
)
}, {
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/font-woff'
}, {
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=application/octet-stream'
}, {
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file'
}, {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=10000&mimetype=image/svg+xml'
}]
},
plugins: [
new ExtractTextPlugin('css/app.css'),
new CopyWebpackPlugin([
{ from: './web/static/assets'},
{ from: './deps/phoenix_html/web/static/js/phoenix_html.js',
to: 'js/phoenix_html.js'
}
])
]
};