From ef6c95157e48da35807146ef307c92463352bccd Mon Sep 17 00:00:00 2001 From: "chengyu.chengyulia" Date: Tue, 3 Aug 2021 19:37:01 +0800 Subject: [PATCH 1/3] feat: production mode useHtmlTemplate --- .../command-build/plugin/build.ts | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/built-in-plugins/command-build/plugin/build.ts b/src/built-in-plugins/command-build/plugin/build.ts index c2d7fa30..f328a189 100644 --- a/src/built-in-plugins/command-build/plugin/build.ts +++ b/src/built-in-plugins/command-build/plugin/build.ts @@ -39,15 +39,17 @@ export const buildProject = async (opts: IOpts = {}) => { outFileName: '[name].js', publicPath: opts.publicPath, // If unset, use config value. pipeConfig: async config => { - staticHtmlPaths.forEach(staticHtmlPath => { - config.plugins.push( - new HtmlWebpackPlugin({ - title: pri.sourceConfig.title || globalState.projectRootPath.split(path.sep).pop(), - filename: staticHtmlPath, - template: path.join(__dirname, '../../../../template-project.ejs'), - }), - ); - }); + if (pri.sourceConfig.useHtmlTemplate) { + staticHtmlPaths.forEach(staticHtmlPath => { + config.plugins.push( + new HtmlWebpackPlugin({ + title: pri.sourceConfig.title || globalState.projectRootPath.split(path.sep).pop(), + filename: staticHtmlPath, + template: path.join(__dirname, '../../../../template-project.ejs'), + }), + ); + }); + } return config; }, }); From daceb3ec5dab9b89b3addef52c6fd2c0b26cf138 Mon Sep 17 00:00:00 2001 From: "chengyu.chengyulia" Date: Tue, 3 Aug 2021 19:37:44 +0800 Subject: [PATCH 2/3] fix: format --- src/utils/ts-plus-babel.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/ts-plus-babel.ts b/src/utils/ts-plus-babel.ts index 4bd1b8e5..4949d3b5 100644 --- a/src/utils/ts-plus-babel.ts +++ b/src/utils/ts-plus-babel.ts @@ -66,7 +66,7 @@ const buildSass = (wholeProject: boolean, sourcePath: string) => { (options, fn) => { return fn(options); }, - {includePaths: path.join(pri.projectRootPath, 'node_modules')}, + { includePaths: path.join(pri.projectRootPath, 'node_modules') }, ), ), ); @@ -80,7 +80,7 @@ const buildLess = (wholeProject: boolean, sourcePath: string) => { (options, fn) => { return fn(options); }, - {paths: [path.join(pri.projectRootPath, 'node_modules', 'includes')]}, + { paths: [path.join(pri.projectRootPath, 'node_modules', 'includes')] }, ), ), ); From ad7e6d668c8d0ce6f0b9a587861af2dabea06232 Mon Sep 17 00:00:00 2001 From: "chengyu.chengyulia" Date: Tue, 3 Aug 2021 19:38:44 +0800 Subject: [PATCH 3/3] chore: update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 780892e0..019621e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pri", - "version": "4.3.10", + "version": "4.3.11", "types": "src/node/index.ts", "main": "built/node/index.js", "scripts": {