-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyleguide.config.js
49 lines (44 loc) · 1.39 KB
/
styleguide.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
40
41
42
43
44
45
46
47
48
49
"use strict";
var path = require('path');
var glob = require('glob');
var webpack = require('webpack');
module.exports = {
title: 'Orion Guide',
assetsDir: path.join(__dirname, 'App'),
components: function() {
return glob.sync(path.resolve(__dirname, 'App/Game/UI/Components/**/*.js')).filter(function(module) {
return /\/[A-Z]\w*\.js$/.test(module);
});
},
updateWebpackConfig: function(webpackConfig, env) {
// Your source files folder or array of folders, should not include node_modules
let dir = path.join(__dirname, 'App');
webpackConfig.module.loaders.push(
// Babel loader will use your project’s .babelrc
{
test: /\.js?$/,
include: dir,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-0', 'react-hmre']
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
]
}
);
webpackConfig.module.loaders.push(
{
test: /\.css$/,
include: path.join(__dirname, 'App'),
loaders: [
'style?sourceMap',
'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]'
]
}
);
return webpackConfig;
},
// Put other configuration options here...
};