-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
63 lines (62 loc) · 1.46 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
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var autoprefixer = require('autoprefixer-stylus');
var path = require('path');
var fontFace = require('stylus-font-face');
module.exports = {
entry: path.join(__dirname, '/src/index.js'),
output: {
path: path.join(__dirname, '/public/build'),
filename: 'main.js',
},
module: {
loaders: [
{
test: /\.(glsl|frag|vert)$/,
loader: 'raw',
exclude: /node_modules/,
},
{
test: /\.(glsl|frag|vert)$/,
loader: 'glslify',
exclude: /node_modules/,
},
{
test: /\.styl$/,
loader: ExtractTextPlugin.extract('css-loader!stylus-loader'),
},
{
test: /\.json$/,
loader: 'json',
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
optional: [
'runtime',
],
},
},
],
},
resolve: {
alias: {
config: path.join(__dirname, '/config'),
lib: path.join(__dirname, '/src/lib'),
style: path.join(__dirname, '/src/style'),
layouts: path.join(__dirname, '/src/layouts'),
components: path.join(__dirname, '/src/components'),
sections: path.join(__dirname, '/src/sections'),
},
},
stylus: {
use: [
autoprefixer({ browsers: ['> 5%'] }),
fontFace({ limit: 80000 }),
],
},
plugins: [
new ExtractTextPlugin('main.css'),
],
};