代码拉取完成,页面将自动刷新
同步操作将从 大漠穷秋/NiceFish-React 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
var pkg = require("./package.json");
var path = require("path");
var webpack = require("webpack");
var HtmlWebpackPlugin = require("html-webpack-plugin");
var MiniCssExtractPlugin = require("mini-css-extract-plugin");
// const copyWebPackPlugin = require("copy-webpack-plugin");
var CleanWebpackPlugin = require("clean-webpack-plugin");
module.exports = {
entry: {
app: path.resolve(__dirname, "src/index.tsx"),
// 将 第三方依赖(node_modules中的) 单独打包
vendor: Object.keys(pkg.dependencies)
},
output: {
path: __dirname + "/docs",
filename: "[name].[chunkhash:8].js"
},
resolve: {
extensions: [".js", ".jsx", ".tsx", ".ts",'.png']
},
mode: "production",
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: [
{
loader: "babel-loader"
}
]
},
{
test: /\.tsx?$/,
loader: "ts-loader",
exclude: /node_modules/
},
{
test: /\.html$/,
use: [
{
loader: "html-loader",
options: { minimize: true }
}
]
},
{
test: /\.(png|jpg|gif)$/i,
use: [
{
loader: "file-loader",
}
]
},
{
test: /\.svg$/,
loader: 'svg-url-loader'
},
{
test: /\.(woff|woff2|tff|eot|ttf)()/i,
use: [
{
loader: "file-loader"
}
]
},
{
test: /\.scss|css$/,
use: [
{ loader: MiniCssExtractPlugin.loader },
"css-loader",
"postcss-loader",
"sass-loader"
]
}
]
},
plugins: [
// webpack 内置的 banner-plugin
new webpack.BannerPlugin("Copyright By yanyunchangfeng"),
new CleanWebpackPlugin(["docs"]),
// html 模板插件
new HtmlWebpackPlugin({
template: __dirname + "/public/index.html",
favicon:'./src/assets/images/nice-fish.png'
}),
// new copyWebPackPlugin([
// {from :'src/assets',to:'assets/',toType:'dir'}
// ]),
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "[name].css",
chunkFilename: "[id].css"
})
]
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。