更新配置,能够简单运行实例.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import * as path from 'path';
|
||||
import * as HardSourceWebpackPlugin from 'hard-source-webpack-plugin';
|
||||
import * as webpack from 'webpack';
|
||||
import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
||||
import * as HardSourceWebpackPlugin from 'hard-source-webpack-plugin';
|
||||
|
||||
const config: webpack.Configuration = {
|
||||
devtool: "source-map",
|
||||
|
@@ -7,11 +7,11 @@ const config: webpack.Configuration = merge(
|
||||
common,
|
||||
{
|
||||
mode: "production",
|
||||
entry: "../src/index.ts",
|
||||
entry: "./src/index.ts",
|
||||
//输出设置
|
||||
output: {
|
||||
filename: "cad.js",
|
||||
path: path.resolve(__dirname, '../umd'),
|
||||
path: path.resolve(__dirname, './umd'),
|
||||
library: "cad",
|
||||
libraryTarget: "umd"
|
||||
},
|
||||
|
@@ -1,13 +1,7 @@
|
||||
import * as webpack from 'webpack';
|
||||
import * as merge from 'webpack-merge';
|
||||
import common from './webpack.umd';
|
||||
import common from './webpack.common';
|
||||
import * as HtmlWebPackPlugin from "html-webpack-plugin";
|
||||
import * as path from 'path';
|
||||
|
||||
function getpath(fileName)
|
||||
{
|
||||
return path.resolve(__dirname, fileName);
|
||||
}
|
||||
|
||||
const config: webpack.Configuration = merge(
|
||||
common,
|
||||
@@ -19,17 +13,19 @@ const config: webpack.Configuration = merge(
|
||||
devServer: {
|
||||
contentBase: "./dist/",
|
||||
port: 7776,
|
||||
hot: true
|
||||
hot: true,
|
||||
},
|
||||
plugins: [
|
||||
// new webpack.NamedModulesPlugin(),//Hot
|
||||
// new webpack.HotModuleReplacementPlugin(),//Hot
|
||||
new webpack.NamedModulesPlugin(),//Hot
|
||||
new webpack.HotModuleReplacementPlugin(),//Hot
|
||||
new HtmlWebPackPlugin({
|
||||
title: "webCAD",
|
||||
// template: getpath('../src/index.html')
|
||||
// template: './src/index.html'
|
||||
}),
|
||||
]
|
||||
}
|
||||
);
|
||||
|
||||
config.externals = {};
|
||||
|
||||
export default config;
|
||||
|
Reference in New Issue
Block a user