UNPKG

2.23 kBJavaScriptView Raw
1/* eslint no-var: 0 */
2var nib = require('nib');
3var path = require('path');
4var webpack = require('webpack');
5
6module.exports = {
7 cache: true,
8 target: 'web',
9 entry: {
10 app: [
11 path.resolve(__dirname, 'src/web/index.js')
12 ],
13 vendor: [
14 ]
15 },
16 output: {
17 path: path.join(__dirname, 'dist/web'),
18 filename: '[name].js'
19 },
20 plugins: [
21 new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js')
22 ],
23 module: {
24 preLoaders: [
25 {
26 test: /\.jsx?$/,
27 loaders: ['eslint'],
28 exclude: /node_modules/
29 },
30 {
31 test: /\.styl$/,
32 loader: 'stylint'
33 }
34 ],
35 loaders: [
36 {
37 test: /\.json$/,
38 loader: 'json'
39 },
40 {
41 test: /\.jsx?$/,
42 loader: 'babel',
43 exclude: /(node_modules|bower_components)/,
44 query: {
45 presets: ['es2015', 'stage-0']
46 }
47 },
48 {
49 test: /\.styl$/,
50 loader: 'style!css!stylus'
51 },
52 {
53 test: /\.css$/,
54 loader: 'style!css'
55 },
56 {
57 test: /\.(png|jpg)$/,
58 loader: 'url',
59 query: {
60 limit: 8192
61 }
62 },
63 {
64 test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
65 loader: 'url',
66 query: {
67 limit: 10000,
68 mimetype: 'application/font-woff'
69 }
70 },
71 {
72 test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
73 loader: 'file'
74 }
75 ]
76 },
77 stylus: {
78 // nib - CSS3 extensions for Stylus
79 use: [nib()],
80 // no need to have a '@import "nib"' in the stylesheet
81 import: ['~nib/lib/nib/index.styl']
82 },
83 resolve: {
84 alias: {},
85 extensions: ['', '.js', '.jsx', '.styl']
86 },
87 node: {
88 fs: 'empty'
89 }
90};