2 Star 0 Fork 0

rAGEnchi Giab/ReactJS.Comonpent

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.js 2.68 KB
一键复制 编辑 原始数据 按行查看 历史
rAGEnchi Giab 提交于 2017-10-10 15:45 . mock adjust
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
var precss = require('precss');
module.exports = {
entry: [
path.resolve(__dirname, 'app/index.jsx')
],
output: {
filename: 'bundle.js',
publicPath: '/dist/app/'
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('dev')
}
})
],
module: {
loaders: [
{
test: /\.less$/,
loader: "style!css!less"
},
{
test: /\.css$/,
loader: "style!css"
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass']
},
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel', // 'babel-loader' is also a legal name to reference
query: {
presets: ['react', 'es2015']
}
},
{
test: /\.js$/,
loader: 'babel',
exclude: /(node_modules|bower_components)/,
include: __dirname,
query: {
presets: ['react', 'es2015','stage-0']
}
},
{ test: /\.woff(\?.*)?$/, loader: 'url?name=fonts/[name].[ext]' },
{ test: /\.woff2(\?.*)?$/, loader: 'url?prefix=fonts/&name=[path][name].[ext]&limit=10000&mimetype=application/font-woff2' },
{ test: /\.otf(\?.*)?$/, loader: 'file?prefix=fonts/&name=[path][name].[ext]&limit=10000&mimetype=font/opentype' },
{ test: /\.ttf(\?.*)?$/, loader: 'url?name=fonts/[name].[ext]' },
{ test: /\.eot(\?.*)?$/, loader: 'url?name=fonts/[name].[ext]' },
{ test: /\.svg(\?.*)?$/, loader: 'url?limit=1024&name=img/[name].[ext]' },
{ test: /\.swf(\?.*)?$/, loader: 'file?prefix=swf/&name=[path][name].[ext]&limit=10000&mimetype=application/swf'},
{ test: /\.(png|jpg|gif)$/, loader: 'url?limit=8192&name=[name]_[hash:8].[ext]' },
{
test: /\.(png|jpg)$/,
loader: 'url-loader?limit=8192'
}
]
},
externals: {
},
//配置目录结构,添加目录接口import时只需要文件名,不需要目录名。
resolve: {
extensions: ['','.js', '.jsx','.scss']
},
devServer: {
port: 1993,
host: 'ragenchi.giab',
hot: true,
quiet:true,
historyApiFallback: {
index: 'index.html'
}
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/0574/ReactJS.Comonpent.git
git@gitee.com:0574/ReactJS.Comonpent.git
0574
ReactJS.Comonpent
ReactJS.Comonpent
master

搜索帮助