代码拉取完成,页面将自动刷新
"use strict";
const webpack = require("webpack");
const fs = require("fs");
// Builds example bundles
module.exports = {
mode: "development",
context: __dirname,
entry: {},
optimization: {
splitChunks: {
cacheGroups: {
commons: {
name: "commons",
chunks: "all",
minChunks: 1
}
}
}
},
output: {
path: __dirname + "/examples",
filename: "[name].js",
sourceMapFilename: "[file].map",
publicPath: "auto"
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "babel-loader",
options: {
cacheDirectory: true
}
}
]
},
plugins: [
new webpack.DefinePlugin({
"process.env.STATIC_EXAMPLES": JSON.stringify(true)
})
],
devServer: {
compress: true,
port: 4002,
open: "/react-grid-layout/examples/0-showcase.html",
client: {
overlay: true
},
static: {
directory: ".",
publicPath: "/react-grid-layout"
}
},
resolve: {
extensions: [".js", ".jsx"],
alias: { "react-grid-layout": __dirname + "/index-dev.js" }
}
};
// Load all entry points
const files = fs
.readdirSync(__dirname + "/test/examples")
.filter(element => element.match(/^.+\.jsx$/));
for (const file of files) {
const module_name = file.replace(/\.jsx$/, "");
module.exports.entry[module_name] = "./test/examples/" + file;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。