-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathwebpack.config.js
More file actions
76 lines (68 loc) · 1.82 KB
/
webpack.config.js
File metadata and controls
76 lines (68 loc) · 1.82 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* eslint-disable */
var autoprefixer = require('autoprefixer');
var path = require("path");
var webpack = require("webpack");
var CopyWebpackPlugin = require("copy-webpack-plugin");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
"js/app.js": "./web/static/js/app.js",
"js/admin.js": "./web/static/js/admin.js",
"css/app.css": "./web/static/css/app.scss",
"css/admin.css": "./web/static/css/admin.scss",
},
output: {
path: __dirname + "/priv/static",
filename: "[name]"
},
resolve: {
modulesDirectories: [
__dirname + "/node_modules",
__dirname + "/web/static/js"
],
alias: {
phoenix_html:
__dirname + "/deps/phoenix_html/web/static/js/phoenix_html.js",
phoenix:
__dirname + "/deps/phoenix/web/static/js/phoenix.js"
}
},
module: {
loaders: [
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader?limit=10000&minetype=application/font-woff&name=./css/[hash].[ext]"
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file-loader?name=./css/[hash].[ext]"
},
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ["babel-loader"],
include: __dirname
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract("css?sourceMap!postcss!sass?outputStyle=expanded&sourceMap&sourceMapContents", {
publicPath: '../'
})
},
],
},
postcss: function () {
return [autoprefixer];
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.Tether": "tether"
}),
new ExtractTextPlugin("[name]", {
allChunks: true
}),
new CopyWebpackPlugin([{ from: "./web/static/assets" }])
]
};