-
Notifications
You must be signed in to change notification settings - Fork 128
/
Copy pathwebpack-examples.config.js
39 lines (31 loc) · 1005 Bytes
/
webpack-examples.config.js
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
var path = require('path');
var _ = require('lodash');
// copy most settings from the default config, and then modify
// the stuff that has changed
var defaultconfig = require('./webpack.config.js');
var examplesconfig = _.cloneDeep(defaultconfig);
var examplesdirectory = path.join(__dirname, "examples");
examplesconfig.entry = {
jsxtransform: path.join(examplesdirectory, "jsxtransform", "jsxtransform.jsx"),
shader: path.join(examplesdirectory, 'shader', 'shader.jsx')
};
examplesconfig.output = {
path: path.join(__dirname, "examples", "build"),
filename: "[name].js",
publicPath: "/examples/build/"
};
// add a jsx processor
examplesconfig.module.loaders.push(
{
test: /\.jsx$/,
loader: 'babel',
include: path.join(__dirname, 'examples'),
query: {
cacheDirectory: true,
presets: ['es2015', 'stage-2', 'react'],
plugins: ['transform-runtime']
}
}
);
examplesconfig.devtool = 'cheap-module-eval-source-map',
module.exports = examplesconfig;