-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
38 lines (37 loc) · 1.14 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
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const autoprefixer = require('autoprefixer-stylus');
module.exports = {
entry: './src/index.js',
output: {
path: path.join(__dirname, 'public'),
publicPath: '../',
filename: 'build/build.js'
},
resolve: {
alias: {
objects: path.join(__dirname, 'src/objects'),
models: path.join(__dirname, 'src/models'),
shaders: path.join(__dirname, 'src/shaders'),
scenes: path.join(__dirname, 'src/scenes'),
lib: path.join(__dirname, 'src/lib')
}
},
module: {
loaders: [
{ test: /\.(woff|woff2|eot|ttf)$/, loader: 'file?name=assets/fonts/[name].[ext]' },
{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ },
{ 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') }
]
},
stylus: {
use: [
autoprefixer()
]
},
plugins: [
new ExtractTextPlugin('build/main.css')
]
};