Repository navigation
Expand file tree
/
Copy pathwebpack.config.js
More file actions
75 lines (72 loc) · 1.69 KB
/
Copy pathwebpack.config.js
File metadata and controls
75 lines (72 loc) · 1.69 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
const skeleton = require('./webpack-skeleton')
const path = require('path')
const stylusLoaderOptions = {
sourceMap: true,
stylusOptions: {
use: [require('nib')()],
import: [
'~nib/lib/nib/index.styl',
path.join(__dirname, 'browser/styles/index.styl')
]
}
}
var config = Object.assign({}, skeleton, {
mode: 'development',
performance: { hints: false },
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: { cacheDirectory: true }
}
},
{
test: /global\.styl$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{ loader: 'stylus-loader', options: stylusLoaderOptions }
]
},
{
test: /\.styl$/,
exclude: /(node_modules|bower_components|global\.styl$)/,
use: [
{ loader: 'style-loader' },
{
loader: 'css-loader',
options: {
modules: {
localIdentName: '[name]__[local]___[path]'
},
importLoaders: 1
}
},
{
loader: 'stylus-loader',
options: stylusLoaderOptions
}
]
}
]
},
output: {
path: path.join(__dirname, 'compiled'),
filename: '[name].js',
sourceMapFilename: '[name].map',
libraryTarget: 'commonjs2',
publicPath: 'http://localhost:8080/assets/'
},
devtool: 'cheap-module-eval-source-map',
devServer: {
port: 8080,
hot: true,
inline: true,
quiet: false,
publicPath: 'http://localhost:8080/assets/'
}
})
module.exports = config