Commit 5322492e by Jay

fix: add webpack.dev.config

parent 94dbfcf5
......@@ -4,6 +4,6 @@ yarn.lock
.DS_Store
/node_modules/react-sticky/package.json
src/.DS_Store
webpack.dev.config.js
# webpack.dev.config.js
packge-lock.json
.cache
/**
* anth: 陈万军
* time: 2020-05-1
* 集成功能: 开发环境
* */
var webpack = require("webpack");
var path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
var config = require("./webpack.base.config.js");
const apiConfig = require("../src/services/baseUrl.js");
const AddAssetHtmlPlugin = require("add-asset-html-webpack-plugin");
var CaseSensitivePathsPlugin = require("case-sensitive-paths-webpack-plugin");
var _ = require("lodash");
const TARGET = process.env.npm_lifecycle_event;
const commonConfig = {
plugins: [
new CaseSensitivePathsPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
PRODUCTION: JSON.stringify(true),
VERSION: JSON.stringify("5fa3b9"),
routerMode: JSON.stringify("hash"),
API_CONFIG: JSON.stringify(apiConfig),
BUILD_VERSION: JSON.stringify(new Date().toString()),
}),
new HtmlWebpackPlugin({
template: "template/index.html",
inject: "body",
filename: "index.html",
}),
// new AddAssetHtmlPlugin({
// filepath: path.resolve(__dirname, '../dist/lib/*.js'),
// }),
new AddAssetHtmlPlugin([
// { filepath: path.resolve(__dirname, '../libs/*.js') },
{ filepath: path.resolve(__dirname, "../jslibs/jweixin.1.4.0.js") },
{ filepath: path.resolve(__dirname, "../jslibs/hd.js") },
{ filepath: path.resolve(__dirname, "../jslibs/variable.js") },
{ filepath: path.resolve(__dirname, "../jslibs/js-rsa.js") },
// { filepath: path.resolve(__dirname, '../jslibs/*.css') },
{ filepath: path.resolve(__dirname, "../jslibs/fastclick.1.0.6.js") },
// { filepath: path.resolve(__dirname, '../jslibs/intl/zh.js') },
{ filepath: path.resolve(__dirname, "../jslibs/plupload-2.1.2/js/*.js") },
{
filepath: path.resolve(
__dirname,
"../jslibs/tinymce/5.2.0/tinymce.min.js"
),
},
]),
],
};
let mergedConfig = commonConfig;
mergedConfig = _.merge(config, commonConfig);
module.exports = mergedConfig;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment