-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
60 lines (59 loc) · 1.42 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
var ProvidePlugin = require('webpack').ProvidePlugin;
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var Autoprefixer = require('autoprefixer');
module.exports = {
entry: [
// import basic styles all over the application
'./styles/app.scss',
// set our app.js as the entry point
// to the PixiJS application
'./app/app',
],
output: {
path: __dirname,
filename: 'bundle.js',
},
module: {
loaders: [
// SASS loader
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('css-loader!postcss-loader!sass-loader')
},
// JavaScript loader
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
// run JS through Babel
loader: 'babel-loader',
query: {
// use the ES6 preset for JS code
presets: ['es2015']
}
},
]
},
plugins: [
// extract compiled CSS
new ExtractTextPlugin('public/styles.css', {
allChunks: true,
}),
new ProvidePlugin({
// extracts pixi.js into the global namespace
PIXI: 'pixi.js',
// extracts jquery into the global namespace
// under $/jQuery variable names
$: 'jquery',
jQuery: 'jquery',
}),
],
resolve: {
extensions: ['', '.js'],
},
// postcss config, runs autoprefixer on compiled CSS
postcss: [
Autoprefixer({
browsers: ['last 2 versions']
})
]
}