Ai
1 Star 0 Fork 0

zhangchenghui/seata.github.io

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.js 1.85 KB
一键复制 编辑 原始数据 按行查看 历史
liandong.cld 提交于 2019-03-01 18:42 +08:00 . feat: 初始提交
const path = require('path');
const fs = require('fs');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const entry = {};
const targetPath = path.join(__dirname, './src/pages');
fs.readdirSync(targetPath).forEach(page => {
if (
fs.statSync(path.join(targetPath, page)).isDirectory() &&
fs.existsSync(path.join(targetPath, page, 'index.jsx'))
) {
entry[page] = path.join(targetPath, page, 'index.jsx');
}
});
module.exports = {
entry,
output: {
path: path.join(__dirname, 'build'),
filename: '[name].js',
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
module: {
loaders: [
{
test: /\.js|jsx$/,
exclude: [/node_modules/, /build\/lib/, /\.min\.js$/],
use: 'babel-loader',
},
{
test: /\.(s)?css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
'css-loader',
'resolve-url-loader',
{
loader: 'sass-loader',
options: {
sourceMap: true, // 结合resolve-url-loader使用必填,详见https://www.npmjs.com/package/resolve-url-loader
sourceMapContents: false,
},
},
],
}),
},
{
test: /\.json?$/,
exclude: /node_modules/,
use: 'json-loader',
},
{
test: /\.(woff|woff2|eot|ttf|otf|svg)((\?|#).*)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
publicPath: './',
},
}],
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.json'],
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new ExtractTextPlugin('[name].css'),
],
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/objcoding/seata.github.io.git
git@gitee.com:objcoding/seata.github.io.git
objcoding
seata.github.io
seata.github.io
master

搜索帮助