react-toolbox/docs/webpack.config.development.js

59 lines
1.6 KiB
JavaScript
Raw Normal View History

2015-10-23 21:02:42 +03:00
const path = require('path');
const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
2015-10-23 02:50:05 +03:00
module.exports = {
2015-10-23 21:02:42 +03:00
context: __dirname,
2015-10-30 06:51:29 +03:00
devtool: 'inline-source-map',
2015-10-23 21:02:42 +03:00
entry: [
2015-10-29 08:33:21 +03:00
'webpack-hot-middleware/client',
'./app/index.jsx'
2015-10-23 21:02:42 +03:00
],
output: {
path: path.join(__dirname, 'build'),
filename: 'docs.js',
publicPath: '/'
2015-10-23 21:02:42 +03:00
},
2015-10-23 02:50:05 +03:00
resolve: {
extensions: ['', '.jsx', '.scss', '.js', '.json', '.md'],
2015-10-23 02:50:05 +03:00
alias: {
'react-toolbox': path.resolve(__dirname + './../components')
},
modulesDirectories: [
'node_modules',
path.resolve(__dirname, './node_modules'),
path.resolve(__dirname, './../node_modules'),
path.resolve(__dirname, './../components')
2015-10-23 02:50:05 +03:00
]
},
module: {
loaders: [
2015-10-23 21:02:42 +03:00
{
test: /(\.js|\.jsx)$/,
exclude: /(node_modules)/,
2015-10-29 08:33:21 +03:00
loader: 'babel'
2015-10-23 21:02:42 +03:00
}, {
test: /(\.scss|\.css)$/,
2015-11-03 11:31:17 +03:00
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap!toolbox')
2015-10-25 16:54:41 +03:00
}, {
test: /(\.txt)$/,
loader: 'raw',
2015-10-30 22:30:56 +03:00
include: path.resolve(__dirname, './app/components/layout/main/modules')
}, {
test: /(\.md)$/,
2015-11-01 21:25:46 +03:00
loader: 'html!highlight!markdown'
2015-10-23 21:02:42 +03:00
}
2015-10-23 02:50:05 +03:00
]
},
2015-10-23 21:02:42 +03:00
postcss: [autoprefixer],
plugins: [
2015-10-29 13:38:42 +03:00
new ExtractTextPlugin('docs.css', { allChunks: true }),
2015-10-23 21:02:42 +03:00
new webpack.HotModuleReplacementPlugin(),
2015-10-29 08:33:21 +03:00
new webpack.NoErrorsPlugin(),
2015-10-23 21:02:42 +03:00
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
})
]
2015-10-23 02:50:05 +03:00
};