Skip to content

Commit 0614561

Browse files
feat: update core
1 parent 40d6d1e commit 0614561

File tree

6 files changed

+20
-103
lines changed

6 files changed

+20
-103
lines changed

lib/handleOptions.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ module.exports = async ({ options, command, env }) => {
104104
options.sourceMap = options.format
105105
? false
106106
: options.sourceMap === false || typeof options.sourceMap === 'string'
107-
? options.sourceMap
108-
: command === 'build'
109-
? 'source-map'
110-
: command === 'test'
111-
? 'inline-source-map'
112-
: 'eval-source-map';
107+
? options.sourceMap
108+
: command === 'build'
109+
? 'source-map'
110+
: command === 'test'
111+
? 'inline-source-map'
112+
: 'eval-source-map';
113113

114114
options.externals = getExternals(options).concat(options.externals || []);
115115
options.babel = await handleBabel(options.babel);

lib/index.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ interface TechpacketBuildToolsOptions {
5252
/**
5353
* The entry file of your app.
5454
*/
55-
entry?: string | string[] | {[k: string]: string[]}
55+
entry?: string | string[] | { [k: string]: string[] }
5656

5757
/**
5858
* The output directory of bundled files.
@@ -67,7 +67,7 @@ interface TechpacketBuildToolsOptions {
6767
/**
6868
* This option specifies the public URL of the output directory when referenced in a browser.
6969
*/
70-
publicPath?:string
70+
publicPath?: string
7171

7272
/**
7373
* Bundle format
@@ -113,6 +113,11 @@ interface TechpacketBuildToolsOptions {
113113
*/
114114
minimize?: boolean
115115

116+
/**
117+
* Uglify options.
118+
*/
119+
uglifyOptions?: boolean
120+
116121
/**
117122
* Customize output filenames
118123
*/

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"techpacket-build-tools": "bin/cli.js"
2828
},
2929
"dependencies": {
30-
"@techpacket-build-tools/core": "^1.0.7",
30+
"@techpacket-build-tools/core": "^1.0.8",
3131
"@techpacket-build-tools/dev-utils": "^1.0.3",
3232
"@techpacket-build-tools/errors": "^1.0.2",
3333
"@techpacket-build-tools/logger": "^1.0.4",

packages/core/createWebpackConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ exports.apply = techpacketBuildTools => {
192192
{
193193
apply(compiler) {
194194
const UglifyJsPlugin = require('terser-webpack-plugin');
195-
new UglifyJsPlugin().apply(compiler);
195+
new UglifyJsPlugin(techpacketBuildTools.options.uglifyOptions || {}).apply(compiler);
196196
},
197197
},
198198
],

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@
4545
"type": "git",
4646
"url": "https://github.com/TechPacket/techpacket-build-tools/tree/master/packages/core"
4747
},
48-
"version": "1.0.7",
48+
"version": "1.0.8",
4949
"gitHead": "1eb433abdd7ef036d1fd62c3a6a798c472dc8e1f"
5050
}

0 commit comments

Comments
 (0)