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

68 lines
1.9 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');
const TransferWebpackPlugin = require('transfer-webpack-plugin');
2015-10-23 02:50:05 +03:00
module.exports = {
2015-10-23 21:02:42 +03:00
context: __dirname,
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',
2016-04-10 22:04:49 +03:00
'./app/index.js'
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: {
2016-04-10 22:04:49 +03:00
extensions: ['', '.scss', '.js', '.json', '.md'],
2016-04-10 12:38:42 +03:00
packageMains: ['browser', 'web', 'browserify', 'main', 'style'],
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
{
2016-04-10 22:04:49 +03:00
test: /\.js$/,
2015-10-23 21:02:42 +03:00
exclude: /(node_modules)/,
2015-10-29 08:33:21 +03:00
loader: 'babel'
2015-10-23 21:02:42 +03:00
}, {
test: /\.(scss|css)$/,
2016-05-27 22:54:16 +03:00
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap')
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],
2016-05-27 22:54:16 +03:00
sassLoader: {
data: '@import "' + path.resolve(__dirname, 'app/theme/_theme.scss') + '";'
},
2015-10-23 21:02:42 +03:00
plugins: [
2015-10-29 13:38:42 +03:00
new ExtractTextPlugin('docs.css', { allChunks: true }),
new TransferWebpackPlugin([{
from: 'www/images',
to: 'images'
}], path.resolve(__dirname, './')),
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
};