代码拉取完成,页面将自动刷新
同步操作将从 DiDi-opensource/pile.js 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const webpack = require('webpack');
const path = require('path');
// const ExtractTextPlugin = require('extract-text-webpack-plugin');
// Create multiple instances
// const ExtractCSS = new ExtractTextPlugin('styles.css');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const autoprefixer = require('autoprefixer');
const precss = require('precss');
// 错误输出
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
module.exports = {
devtool: 'cheap-module-source-map', // 生成map文件
context: path.resolve(__dirname, 'example'),
entry: {
main: './index',
},
output: {
filename: 'dist/[name].js',
chunkFilename: 'dist/[id].[name].js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
},
module: {
rules: [
// {
// test: /\.(js|jsx)$/,
// loader: 'eslint-loader',
// include: [
// path.resolve(__dirname, 'src/components/badge'),
// ],
// enforce: 'pre',
// options: {
// formatter: require('eslint-friendly-formatter')
// }
// },
{
test: /\.(js|jsx)$/,
include: [
path.resolve(__dirname, 'example'),
path.resolve(__dirname, 'src'),
],
exclude: /node_modules/,
use: [{
loader: 'babel-loader',
}],
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader',
'postcss-loader',
'less-loader',
],
},
{
test: /\.less$/,
use: [
'style-loader',
'css-loader',
'postcss-loader',
'less-loader',
],
},
{
test: /\.(eot|svg|ttf|woff|woff2)\w*/,
use: [{
loader: 'file-loader',
}],
},
{
test: /\.(png|jpg|gif)$/,
use: [{
loader: 'url-loader?limit=1000',
}],
},
{
test: [/\.jsx$/, /\.es6$/],
exclude: /(node_modules|bower_components)/,
use: [
{ loader: 'babel-loader' },
],
},
],
},
resolve: {
extensions: ['.js', '.jsx', '.es6'],
modules: [path.resolve(__dirname, 'example'), 'node_modules'],
},
plugins: [
new webpack.LoaderOptionsPlugin({
options: {
postcss() {
return [precss, autoprefixer];
},
},
}),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './index.html',
filename: 'index.html',
}),
new FriendlyErrorsPlugin(),
],
devServer: {
port: 3004,
host: '0.0.0.0',
historyApiFallback: true,
noInfo: false,
https: false,
disableHostCheck: true,
proxy: {
changeOrigin: true,
},
// stats: 'minimal'
},
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。