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

60 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,
devtool: '#eval-source-map',
entry: [
'webpack-dev-server/client?http://0.0.0.0:8080',
2015-10-23 21:02:42 +03:00
'webpack/hot/only-dev-server',
2015-10-25 16:54:41 +03:00
'./app/app.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)/,
loader: 'react-hot!babel'
}, {
test: /(\.scss|\.css)$/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass')
2015-10-25 16:54:41 +03:00
}, {
test: /(\.txt)$/,
loader: 'raw',
2015-10-25 16:54:41 +03:00
include: path.resolve(__dirname, './app/examples')
}, {
test: /(\.md)$/,
loader: 'html!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: [
new ExtractTextPlugin('docs.css', {allChunks: true}),
2015-10-23 21:02:42 +03:00
new webpack.HotModuleReplacementPlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
})
]
2015-10-23 02:50:05 +03:00
};