mirror of
https://github.com/wassname/react-webpack-template.git
synced 2026-06-27 22:08:18 +08:00
69 lines
1.5 KiB
JavaScript
69 lines
1.5 KiB
JavaScript
var path = require('path');
|
|
|
|
var port = 8000;
|
|
var srcPath = path.join(__dirname, '/../src');
|
|
var publicPath = '/assets/';
|
|
|
|
module.exports = {
|
|
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/'
|
|
}
|
|
},
|
|
module: {
|
|
preLoaders: [
|
|
{
|
|
test: /\.(js|jsx)$/,
|
|
include: path.join(__dirname, 'src'),
|
|
loader: 'eslint-loader'
|
|
}
|
|
],
|
|
loaders: [
|
|
{
|
|
test: /\.css$/,
|
|
loader: 'style!css'
|
|
},
|
|
{
|
|
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'
|
|
}
|
|
]
|
|
}
|
|
};
|