mirror of
https://github.com/wassname/react-webpack-template.git
synced 2026-06-28 01:46:10 +08:00
79 lines
1.9 KiB
JavaScript
79 lines
1.9 KiB
JavaScript
'use strict';
|
|
let path = require('path');
|
|
|
|
let port = 8000;
|
|
let srcPath = path.join(__dirname, '/../src');
|
|
let publicPath = '/assets/';
|
|
|
|
// Additional npm or bower modules to include in builds
|
|
// Add all foreign plugins you may need into this array
|
|
// @example:
|
|
// let npmBase = path.join(__dirname, '../node_modules');
|
|
// let additionalPaths = [ path.join(npmBase, 'react-bootstrap') ];
|
|
let additionalPaths = [];
|
|
|
|
module.exports = {
|
|
additionalPaths: additionalPaths,
|
|
port: port,
|
|
debug: true,
|
|
output: {
|
|
path: path.join(__dirname, '/../dist/assets'),
|
|
filename: 'app.js',
|
|
publicPath: publicPath
|
|
},
|
|
devServer: {
|
|
contentBase: './src/',
|
|
historyApiFallback: true,
|
|
hot: true,
|
|
port: port,
|
|
publicPath: publicPath,
|
|
noInfo: false
|
|
},
|
|
resolve: {
|
|
extensions: ['', '.js', '.jsx'],
|
|
alias: {
|
|
actions: srcPath + '/actions/',
|
|
components: srcPath + '/components/',
|
|
sources: srcPath + '/sources/',
|
|
stores: srcPath + '/stores/',
|
|
styles: srcPath + '/styles/',
|
|
config: srcPath + '/config/' + process.env.REACT_WEBPACK_ENV
|
|
}
|
|
},
|
|
module: {
|
|
preLoaders: [
|
|
{
|
|
test: /\.(js|jsx)$/,
|
|
include: srcPath,
|
|
loader: 'eslint-loader'
|
|
}
|
|
],
|
|
loaders: [
|
|
{
|
|
test: /\.css$/,
|
|
loader: 'style-loader!css-loader'
|
|
},
|
|
{
|
|
test: /\.sass/,
|
|
loader: 'style-loader!css-loader!sass-loader?outputStyle=expanded&indentedSyntax'
|
|
},
|
|
{
|
|
test: /\.scss/,
|
|
loader: 'style-loader!css-loader!sass-loader?outputStyle=expanded'
|
|
},
|
|
{
|
|
test: /\.less/,
|
|
loader: 'style-loader!css-loader!less-loader'
|
|
},
|
|
{
|
|
test: /\.styl/,
|
|
loader: 'style-loader!css-loader!stylus-loader'
|
|
},
|
|
{
|
|
test: /\.(png|jpg|gif|woff|woff2)$/,
|
|
loader: 'url-loader?limit=8192'
|
|
}
|
|
]
|
|
}
|
|
};
|