forked from mozilla/advocacy.mozilla.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
48 lines (46 loc) · 1.16 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
require(`habitat`).load();
var path = require(`path`);
var webpack = require(`webpack`);
var ExtractTextPlugin = require(`extract-text-webpack-plugin`);
var autoprefixer = require(`autoprefixer`);
module.exports = {
entry: [`./dist/client.js`, `./less/index.less`],
output: {
filename: `[name].js`,
chunkFilename: `[id].chunk.js`,
path: path.join(`public`, `build`),
publicPath: `/build/`
},
resolve: {
extensions: [``, `.js`]
},
module: {
loaders: [
{
test: /\.json$/,
loaders: [`json-loader`] },
{
test: /\.png/,
loaders: [`file-loader`] },
{
test: /\.(otf|eot|svg|ttf|woff|woff2)(\?.+)?$/,
loader: `url-loader?limit=8192`
},
{
test: /\.less$/,
loader: ExtractTextPlugin.extract(`style-loader`, `css-loader!postcss-loader!less-loader`),
exclude: [`node_modules`]
}
]
},
postcss: [autoprefixer],
plugins: [
new webpack.DefinePlugin({
'process.env': JSON.stringify({
BASKET_URL: process.env.BASKET_URL,
GA_TRACKING_ID: process.env.GA_TRACKING_ID
})
}),
new ExtractTextPlugin(`[name].css`)
]
};