-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
72 lines (71 loc) · 1.73 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
72
var Autoprefixer = require('autoprefixer');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: [
'./web/static/css/app.scss',
'./web/static/js/app.js'
],
output: {
path: './priv/static',
filename: 'js/app.js'
},
module: {
loaders: [
{
test: /\.elm$/,
exclude: [/elm-stuff/, /node_modules/],
loader: 'elm-webpack'
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015']
}
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style', ['css', 'postcss'])
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style', ['css', 'postcss', 'sass'])
},
{
test: /\.(eot|svg|ttf)(\?v=\d+\.\d+\.\d+)?$/,
loader: "file?name=css/[name].[ext]"
},
{
test: /\.woff(2)?(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=application/font-woff&name=css/[name].[ext]"
}
]
},
plugins: [
new CopyWebpackPlugin([{ from: './web/static/assets' }]),
new ExtractTextPlugin('css/app.css', { allChunks: true })
],
resolve: {
modulesDirectories: ['node_modules', __dirname + '/web/static/js']
},
elm: {
pathToMake: __dirname + '/node_modules/.bin/elm-make',
cwd: __dirname + '/web/static/elm'
},
fileLoader: {
publicPath: function (url) {
return url.split("/")[1];
}
},
postcss: function () {
return [Autoprefixer];
},
sassLoader: {
includePaths: [
__dirname + '/node_modules',
__dirname + '/web/static/vendor/css'
]
}
};