-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dist.coffee
53 lines (49 loc) · 1.18 KB
/
webpack.config.dist.coffee
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
webpack = require 'webpack'
path = require 'path'
nib = require 'nib'
stylus = require 'stylus'
ManifestPlugin = require 'webpack-manifest-plugin'
banner = 'Copyright 2015 Thomas Yang http://thomas-yang.me/'
paths =
src: path.join(__dirname, 'src')
dest: path.join(__dirname, 'dist')
module.exports =
entry: [
paths.src + '/coffee/main.coffee'
]
output:
path: paths.dest
filename: 'main.[hash].js'
resolve:
# you can now require('file') instead of require('file.coffee')
extensions: ['', '.js', '.json', '.coffee', '.css', '.styl']
module:
loaders: [
{
test: /\.coffee$/
exclude: /node_modules/
loader: 'coffee-loader'
},
{
test: /\.styl$/
loader: 'style-loader!css-loader!stylus-loader?resolve url'
},
{
test: /\.(eot|ttf|woff|svg|otf)$/
loader: 'url?limit=100000'
}
],
stylus:
use: [nib()]
define:
url: stylus.url
paths: [__dirname + '/src']
limit: false
plugins: [
new ManifestPlugin()
new webpack.BannerPlugin(banner)
new webpack.optimize.UglifyJsPlugin
sourceMap: false
compress: true
mangle: true
]