forked from schneidmaster/react-coffee-and-friends
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.coffee
50 lines (44 loc) · 1.35 KB
/
webpack.config.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
path = require('path')
webpack = require('webpack')
StaticSiteGeneratorPlugin = require('static-site-generator-webpack-plugin')
SitemapPlugin = require('sitemap-webpack-plugin')
ExtractTextPlugin = require('extract-text-webpack-plugin')
# Insert list of paths here
paths = ['/']
module.exports =
entry: './coffee/router'
output:
filename: 'production.min.js'
path: './dist'
libraryTarget: 'umd'
publicPath: '/'
module:
loaders: [
{
test: /\.coffee$/
loaders: ['react-hot', 'coffee', 'cjsx']
}
{
test: /\.json$/
loaders: ['json']
}
{
test: /\.scss$/
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!resolve-url-loader!sass-loader')
}
{
test: /\.(png|ico|svg|ttf|otf|woff|woff2|eot)$/
loaders: ['file?name=[name].[ext]']
}
]
plugins: [
new StaticSiteGeneratorPlugin('main', paths)
new ExtractTextPlugin('production.min.css', allChunks: true)
new SitemapPlugin('https://YOURDOMAIN.com', paths)
new webpack.DefinePlugin(
__PROD__: process.env.BUILD_PROD is 'true'
)
]
resolve:
root: [path.resolve('./coffee'), path.resolve('./'), path.resolve('./node_modules')]
extensions: ['', '.js', '.json', '.coffee', '.scss']