forked from appnexus/lucid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
66 lines (64 loc) · 1.35 KB
/
Copy pathwebpack.config.js
File metadata and controls
66 lines (64 loc) · 1.35 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
// This file exists for the docs generation
var path = require('path');
var autoprefixer = require('autoprefixer');
var gulpConfig = require('./gulp/config');
var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
devtool: 'cheap-module-eval-source-map',
context: __dirname,
entry: [
'./src/docs/index.html',
'./src/docs/index.jsx',
],
output: {
path: path.join(__dirname, '/dist/docs'),
filename: 'bundle.js',
},
devServer: {
contentBase: 'dist/docs',
},
postcss: function() {
return [
autoprefixer({
browsers: gulpConfig.AUTOPREFIXER_BROWSERS,
}),
];
},
module: {
loaders: [
{
test: /\.html$/,
loader: 'file?name=index.html',
},
{
test: /\.jsx?$/,
loader: 'babel',
exclude: /(node_modules)/,
},
{
test: /\.less$/,
loaders: ['style', 'css?sourceMap', 'postcss', 'less?sourceMap'],
},
{
test: /\.json/,
loader: 'json',
},
],
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
plugins: [
// Move static images over as well. This isn't normally something you do
// with webpack but it works fine for our case.
new CopyWebpackPlugin([
{ from: './src/docs/img', to: 'img' },
]),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
},
}),
],
};