更新配置,能够简单运行实例.

This commit is contained in:
ChenX
2018-10-12 17:02:10 +08:00
parent 2ef48e17c6
commit bda2b05204
66 changed files with 732 additions and 4481 deletions

View File

@@ -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",

View File

@@ -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"
},

View File

@@ -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;