Skip to content
This repository was archived by the owner on Feb 22, 2021. It is now read-only.

Commit 70185f8

Browse files
committed
build: use tsc compile first
1 parent daae9c2 commit 70185f8

File tree

4 files changed

+69
-15
lines changed

4 files changed

+69
-15
lines changed

build/main/webpack.prod.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ module.exports = {
1313
filename: '[name].js',
1414
},
1515

16+
target: 'web',
17+
1618
resolve: {
1719
extensions: ['.ts', '.js'],
1820
},
@@ -30,24 +32,20 @@ module.exports = {
3032
},
3133
{
3234
test: /\.ts$/,
33-
loaders: [
34-
{
35-
loader: 'awesome-typescript-loader',
36-
options: { configFileName: path.resolve(__dirname, '../../tsconfig.json') },
37-
},
38-
],
35+
loader: 'ts-loader',
36+
exclude: /node_modules/,
37+
options: {
38+
configFile: path.resolve(__dirname, '../../tsconfig.json'),
39+
},
3940
},
4041
],
41-
42-
exprContextCritical: false,
4342
},
4443

4544
plugins: [
4645
new webpack.NoEmitOnErrorsPlugin(),
4746

4847
new webpack.optimize.UglifyJsPlugin({
49-
mangle: { keep_fnames: true },
50-
sourceMap: false,
48+
compress: { warnings: false },
5149
}),
5250
],
5351
}

package-lock.json

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "back-loader",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "",
5-
"main": "release/index.d.ts",
6-
"unpkg": "release/back-loader.js",
5+
"main": "release/index",
6+
"unpkg": "release/index.js",
77
"author": "WittBulter(nanazuimeng123@gmail.com)",
88
"homepage": "https://github.com/DhyanaChina/back-loader#readme",
99
"license": "MIT",
@@ -13,7 +13,7 @@
1313
"cover:hook": "./node_modules/.bin/nyc mocha && cat ./coverage/lcov.info | coveralls",
1414
"ex": "tsc ./build/webpack.dev.ts && env DEBUG=true webpack-dev-server --config build/webpack.dev.js --inline --progress --port 1338 && npm run clean:tsc",
1515
"ex:build": "tsc ./build/webpack.prod.ts && rm -rf dist && webpack --config build/webpack.prod.js && npm run clean:tsc",
16-
"release": "tsc ./build/main/webpack.prod.ts && rm -rf release && webpack --config build/main/webpack.prod.js && npm run clean:tsc",
16+
"release": "tsc -p ./tsconfig.json",
1717
"clean:tsc": "find build -name '*.js' | xargs rm -f",
1818
"clean:cover": "rm -rf coverage .nyc_output",
1919
"clean:build": "rm -rf dist release",
@@ -42,6 +42,7 @@
4242
"@types/html-webpack-plugin": "^2.30.1",
4343
"@types/jsdom": "^11.0.4",
4444
"@types/mocha": "^2.2.46",
45+
"@types/parse5": "^3.0.0",
4546
"@types/webpack": "^3.8.2",
4647
"@types/webpack-merge": "^4.1.1",
4748
"awesome-typescript-loader": "^3.4.1",
@@ -55,6 +56,7 @@
5556
"jsdom": "^11.5.1",
5657
"mocha": "^4.1.0",
5758
"nyc": "^11.4.1",
59+
"ts-loader": "^3.2.0",
5860
"ts-node": "^4.1.0",
5961
"tslint": "^5.8.0",
6062
"tslint-loader": "^3.5.3",

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
"compilerOptions": {
33
"lib": ["es2015", "dom"],
44
"target": "es5",
5+
"module": "es6",
6+
"moduleResolution": "node",
57
"declaration": true,
68
"outDir": "release/",
7-
"sourceMap": true,
9+
"sourceMap": false,
810
"removeComments": true,
911
"noImplicitAny": false,
1012
"preserveConstEnums": true,

0 commit comments

Comments
 (0)