From b487efe48d2eaf51782dc5402ab79c7f3397de10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?moxhe=28=E4=BD=95=E7=92=87=29?= Date: Mon, 20 Aug 2018 16:08:10 +0800 Subject: [PATCH 1/8] fix: resource path error when using filename to specific html output path --- lib/Resource.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Resource.js b/lib/Resource.js index ef8bac6..57af19c 100644 --- a/lib/Resource.js +++ b/lib/Resource.js @@ -175,8 +175,8 @@ class Resource { const outToNewNodes = (fileName, fileContent) => { // resource should load in URL relative to html output path let resourceRelative2HTMLPath = url.resolve(webpackOutputPublicPath, fileName); - resourceRelative2HTMLPath = util.urlRelative(htmlOutputURL, resourceRelative2HTMLPath); - resourceRelative2HTMLPath = url.resolve(webpackOutputPublicPath, resourceRelative2HTMLPath); + // resourceRelative2HTMLPath = util.urlRelative(htmlOutputURL, resourceRelative2HTMLPath); + // resourceRelative2HTMLPath = url.resolve(webpackOutputPublicPath, resourceRelative2HTMLPath); if (type === 'script') { // output js file only From 13b2fb58581423eb47993be3802d59222fbd8964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?moxhe=28=E4=BD=95=E7=92=87=29?= Date: Mon, 20 Aug 2018 16:08:23 +0800 Subject: [PATCH 2/8] chore: 1.0.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 287cad6..0c93e6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "web-webpack-plugin", - "version": "1.10.6", + "name": "@tencent/web-webpack-plugin", + "version": "1.0.0", "description": "web plugin for webpack, alternatives for html-webpack-plugin, use HTML as entry", "keywords": [ "webpack", From 016ae13e9ea25170aca7dbfb0dae260972b6d4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?moxhe=28=E4=BD=95=E7=92=87=29?= Date: Wed, 22 Aug 2018 11:00:50 +0800 Subject: [PATCH 3/8] feat: add fragment resource type --- lib/HTMLDocument.js | 7 +++++++ lib/Resource.js | 17 +++++++++++++++-- lib/WebPlugin.js | 4 ++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/lib/HTMLDocument.js b/lib/HTMLDocument.js index 68ea96c..ef17c71 100644 --- a/lib/HTMLDocument.js +++ b/lib/HTMLDocument.js @@ -55,6 +55,11 @@ class HTMLDocument { * @type {Array} */ this.stylesResources = []; + /** + * all html fragmnet Resource this page required + * @type {Array} + */ + this.fragmentResources = []; /** * all style Resource this page required * @type {Array} @@ -116,6 +121,8 @@ class HTMLDocument { this.scriptResources.push(resource); } else if (type === 'style') { this.stylesResources.push(resource); + } else if (type === 'fragment') { + this.fragmentResources.push(resource); } else if (type === 'comment') { if (resource.data === 'SCRIPT') { this.scriptInjectCommentNode = resource.node; diff --git a/lib/Resource.js b/lib/Resource.js index 57af19c..2a7971d 100644 --- a/lib/Resource.js +++ b/lib/Resource.js @@ -113,6 +113,9 @@ class Resource { if (rel === 'stylesheet' && typeof href === 'string') { this.type = 'style'; this.parseQuery(href); + } else if (rel === 'import' && typeof href === 'string') { + this.type = 'fragment'; + this.parseQuery(href); } } else if (nodeName === '#comment') { // any comment @@ -168,7 +171,7 @@ class Resource { const parentNode = this.node.parentNode; const { chunkName, outputNodes, resourceAttr, type } = this; const { assets } = compilation; - const htmlOutputURL = url.resolve(webpackOutputPublicPath, this.options.filename); + // const htmlOutputURL = url.resolve(webpackOutputPublicPath, this.options.filename); let newNodes = []; // add a file to newNodes @@ -216,6 +219,16 @@ class Resource { })); } } + } else if (type === 'fragment') { + if (fileName.endsWith('.html')) { + if (resourceAttr.inline) { + const nodes = parse5.parseFragment(fileContent); + + newNodes = newNodes.concat(nodes.childNodes); + } else { + newNodes.push(this.node); + } + } } else if (type === 'other') { // load this other file with URL let urlContent; @@ -264,7 +277,7 @@ class Resource { // 如果这个文件存在就认为这是一个直接导入本地文件的资源。 const fileContent = fs.readFileSync(filePath, { // 如果是 文本文件 'script', 'style' 就读出文本,其它的按照二进制格式读取 - encoding: ['script', 'style'].indexOf(this.type) >= 0 ? 'utf8' : undefined + encoding: ['script', 'style', 'fragment'].indexOf(this.type) >= 0 ? 'utf8' : undefined }); // 从文件的路径中解析出文件的名称 diff --git a/lib/WebPlugin.js b/lib/WebPlugin.js index 9bc4efe..8903b7d 100644 --- a/lib/WebPlugin.js +++ b/lib/WebPlugin.js @@ -126,6 +126,10 @@ class WebPlugin { this.htmlDocument.stylesResources.forEach(styleResource => { styleResource.out(compilation); }); + // out fragments to html document + this.htmlDocument.fragmentResources.forEach(fragmentResource => { + fragmentResource.out(compilation); + }); // out others to html document this.htmlDocument.otherResources.forEach(otherResource => { otherResource.out(compilation); From d3e8b1c3b194ab90effe8c1131a132d94482eeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?moxhe=28=E4=BD=95=E7=92=87=29?= Date: Fri, 19 Oct 2018 10:45:50 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix:=20Resource=E8=BE=93=E5=87=BA=E6=97=B6?= =?UTF-8?q?=E6=89=BE=E4=B8=8D=E5=88=B0chunk=E4=B8=8E=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=97=B6=EF=BC=8C=E8=BE=93=E5=87=BA=E7=A9=BA?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Resource.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Resource.js b/lib/Resource.js index 7081c98..d000685 100644 --- a/lib/Resource.js +++ b/lib/Resource.js @@ -321,12 +321,12 @@ class Resource { if (resourceAttr.ie) { newNodes = surroundWithIE(newNodes, parentNode); } - - util.replaceNodesWithNodes(outputNodes, newNodes); - this.outputNodes = newNodes; } catch (err) { //读取文件失败 } + + util.replaceNodesWithNodes(outputNodes, newNodes); + this.outputNodes = newNodes; } // 剩下的情况就把outputNodes 保留在文档流里不动outputNodes。 // 比如引入自定义url http://qq.com/hi.js From 367aa72a8d28a3a769cd39a11e62887efeebfc9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?moxhe=28=E4=BD=95=E7=92=87=29?= Date: Fri, 19 Oct 2018 10:46:51 +0800 Subject: [PATCH 5/8] chore: 2.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c122768..466df97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tencent/web-webpack-plugin", - "version": "2.0.0", + "version": "2.0.1", "description": "web plugin for webpack, alternatives for html-webpack-plugin, use HTML as entry", "keywords": [ "webpack", From 85b1c86c3b1bcac6d2bed570c29883dda24ea369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?moxhe=28=E4=BD=95=E7=92=87=29?= Date: Wed, 21 Nov 2018 15:51:28 +0800 Subject: [PATCH 6/8] =?UTF-8?q?Revert=20"fix:=20Resource=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E6=97=B6=E6=89=BE=E4=B8=8D=E5=88=B0chunk=E4=B8=8E=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E6=96=87=E4=BB=B6=E6=97=B6=EF=BC=8C=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E7=A9=BA=E8=8A=82=E7=82=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 模版中other类型的标签会被干掉 This reverts commit d3e8b1c3b194ab90effe8c1131a132d94482eeb5. --- lib/Resource.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Resource.js b/lib/Resource.js index d000685..7081c98 100644 --- a/lib/Resource.js +++ b/lib/Resource.js @@ -321,12 +321,12 @@ class Resource { if (resourceAttr.ie) { newNodes = surroundWithIE(newNodes, parentNode); } + + util.replaceNodesWithNodes(outputNodes, newNodes); + this.outputNodes = newNodes; } catch (err) { //读取文件失败 } - - util.replaceNodesWithNodes(outputNodes, newNodes); - this.outputNodes = newNodes; } // 剩下的情况就把outputNodes 保留在文档流里不动outputNodes。 // 比如引入自定义url http://qq.com/hi.js From ac5511e5af9fcb091ac41e4dfa9fdc71a8fbaf14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?moxhe=28=E4=BD=95=E7=92=87=29?= Date: Wed, 21 Nov 2018 15:52:41 +0800 Subject: [PATCH 7/8] chore: 2.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 466df97..da87cc8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tencent/web-webpack-plugin", - "version": "2.0.1", + "version": "2.0.2", "description": "web plugin for webpack, alternatives for html-webpack-plugin, use HTML as entry", "keywords": [ "webpack", From fddeb9105bd727df873a89df6cd80be1ebb286cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?moxhe=28=E4=BD=95=E7=92=87=29?= Date: Wed, 23 Jan 2019 16:02:08 +0800 Subject: [PATCH 8/8] =?UTF-8?q?test:=20=E6=B7=BB=E5=8A=A0demo:auto-plugin-?= =?UTF-8?q?use-template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/auto-plugin-use-template/README.md | 66 +++++++++++++++++++ .../dist-js-prod/common.css | 4 ++ .../dist-js-prod/common.js | 1 + .../dist-js-prod/home.css | 4 ++ .../dist-js-prod/home.html | 20 ++++++ .../dist-js-prod/home.js | 1 + .../dist-js-prod/ie_polyfill.js | 1 + .../dist-js-prod/login.css | 4 ++ .../dist-js-prod/login.html | 20 ++++++ .../dist-js-prod/login.js | 1 + .../dist-js-prod/pagemap.json | 1 + .../dist-js-prod/polyfill.js | 1 + .../dist-js-prod/signup.css | 4 ++ .../dist-js-prod/signup.html | 20 ++++++ .../dist-js-prod/signup.js | 1 + demo/auto-plugin-use-template/dist/common.css | 4 ++ demo/auto-plugin-use-template/dist/common.js | 1 + demo/auto-plugin-use-template/dist/home.css | 4 ++ demo/auto-plugin-use-template/dist/home.html | 13 ++++ demo/auto-plugin-use-template/dist/home.js | 1 + .../dist/ie_polyfill.js | 1 + demo/auto-plugin-use-template/dist/login.css | 4 ++ demo/auto-plugin-use-template/dist/login.html | 13 ++++ demo/auto-plugin-use-template/dist/login.js | 1 + .../dist/pagemap.json | 1 + .../auto-plugin-use-template/dist/polyfill.js | 1 + demo/auto-plugin-use-template/dist/signup.css | 4 ++ .../auto-plugin-use-template/dist/signup.html | 13 ++++ demo/auto-plugin-use-template/dist/signup.js | 1 + .../src/home/index.css | 3 + .../src/home/index.js | 4 ++ .../src/ie_polyfill.js | 1 + .../src/ignore/index.css | 3 + .../src/ignore/index.js | 1 + .../src/login/index.css | 3 + .../src/login/index.js | 4 ++ demo/auto-plugin-use-template/src/polyfill.js | 1 + .../src/signup/index.css | 3 + .../src/signup/index.js | 4 ++ .../src/template.html | 17 +++++ .../webpack.config.js | 49 ++++++++++++++ package.json | 1 + 42 files changed, 305 insertions(+) create mode 100644 demo/auto-plugin-use-template/README.md create mode 100644 demo/auto-plugin-use-template/dist-js-prod/common.css create mode 100644 demo/auto-plugin-use-template/dist-js-prod/common.js create mode 100644 demo/auto-plugin-use-template/dist-js-prod/home.css create mode 100644 demo/auto-plugin-use-template/dist-js-prod/home.html create mode 100644 demo/auto-plugin-use-template/dist-js-prod/home.js create mode 100644 demo/auto-plugin-use-template/dist-js-prod/ie_polyfill.js create mode 100644 demo/auto-plugin-use-template/dist-js-prod/login.css create mode 100644 demo/auto-plugin-use-template/dist-js-prod/login.html create mode 100644 demo/auto-plugin-use-template/dist-js-prod/login.js create mode 100644 demo/auto-plugin-use-template/dist-js-prod/pagemap.json create mode 100644 demo/auto-plugin-use-template/dist-js-prod/polyfill.js create mode 100644 demo/auto-plugin-use-template/dist-js-prod/signup.css create mode 100644 demo/auto-plugin-use-template/dist-js-prod/signup.html create mode 100644 demo/auto-plugin-use-template/dist-js-prod/signup.js create mode 100644 demo/auto-plugin-use-template/dist/common.css create mode 100644 demo/auto-plugin-use-template/dist/common.js create mode 100644 demo/auto-plugin-use-template/dist/home.css create mode 100644 demo/auto-plugin-use-template/dist/home.html create mode 100644 demo/auto-plugin-use-template/dist/home.js create mode 100644 demo/auto-plugin-use-template/dist/ie_polyfill.js create mode 100644 demo/auto-plugin-use-template/dist/login.css create mode 100644 demo/auto-plugin-use-template/dist/login.html create mode 100644 demo/auto-plugin-use-template/dist/login.js create mode 100644 demo/auto-plugin-use-template/dist/pagemap.json create mode 100644 demo/auto-plugin-use-template/dist/polyfill.js create mode 100644 demo/auto-plugin-use-template/dist/signup.css create mode 100644 demo/auto-plugin-use-template/dist/signup.html create mode 100644 demo/auto-plugin-use-template/dist/signup.js create mode 100644 demo/auto-plugin-use-template/src/home/index.css create mode 100644 demo/auto-plugin-use-template/src/home/index.js create mode 100644 demo/auto-plugin-use-template/src/ie_polyfill.js create mode 100644 demo/auto-plugin-use-template/src/ignore/index.css create mode 100644 demo/auto-plugin-use-template/src/ignore/index.js create mode 100644 demo/auto-plugin-use-template/src/login/index.css create mode 100644 demo/auto-plugin-use-template/src/login/index.js create mode 100644 demo/auto-plugin-use-template/src/polyfill.js create mode 100644 demo/auto-plugin-use-template/src/signup/index.css create mode 100644 demo/auto-plugin-use-template/src/signup/index.js create mode 100644 demo/auto-plugin-use-template/src/template.html create mode 100644 demo/auto-plugin-use-template/webpack.config.js diff --git a/demo/auto-plugin-use-template/README.md b/demo/auto-plugin-use-template/README.md new file mode 100644 index 0000000..8932ea1 --- /dev/null +++ b/demo/auto-plugin-use-template/README.md @@ -0,0 +1,66 @@ +# 管理多个单页应用 + +`AutoWebPlugin` 可以自动管理多个单页应用。简单使用如下 + +```js +const path = require('path'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const { AutoWebPlugin } = require('../../index'); + +const autoWebPlugin = new AutoWebPlugin('./src/', { + ignorePages: ['ignore'], + template: './src/template.html', + outputPagemap: true, +}); + +module.exports = { + output: { + path: path.resolve(__dirname, 'dist'), + filename: '[name].js', + publicPath: 'https://cdn.cn/', + }, + entry: autoWebPlugin.entry({ + ie_polyfill: './src/ie_polyfill', + polyfill: './src/polyfill', + }), + optimization: { + splitChunks: { + minSize: 0, + cacheGroups: { + commons: { + chunks: 'initial', + name: 'common', + minChunks: 2, + }, + }, + }, + }, + module: { + rules: [ + { + test: /\.css$/, + loader: [MiniCssExtractPlugin.loader, 'css-loader'], + }, + ], + }, + plugins: [ + new MiniCssExtractPlugin({ + filename: '[name].css', + }), + autoWebPlugin, + ], +}; +``` + +以上配置会让`AutoWebPlugin`找出`./src/`目录下的所有目录,为每个目录生产一个 HTML 作为单页应用的入口。 + +* `ignorePages` 属性用了忽略名叫`ignore`的目录,不为这个目录生产 HTML 入口 +* `template` 属性指出所有单页应用生产 HTML 入口时公用的 HTML 模版,模版语法和`WebPlugin`里一致。 +* `outputPagemap` 属性用来输出一个叫`pagemap.json`的文件,里面存放了`AutoWebPlugin`找出的所有单页应用的名称和 URL 的映射关系。 + +`AutoWebPlugin`还支持很多配置选项,你可以[在这里看到](https://github.com/gwuhaolin/web-webpack-plugin/blob/master/lib/AutoWebPlugin.js#L33)。 + +更多关于`AutoWebPlugin`的资料可以参考以下文章: + +* [webpack 原理与实战](https://github.com/gwuhaolin/blog/issues/4) +* [webpack2 终极优化](https://github.com/gwuhaolin/blog/issues/2) diff --git a/demo/auto-plugin-use-template/dist-js-prod/common.css b/demo/auto-plugin-use-template/dist-js-prod/common.css new file mode 100644 index 0000000..d2dfe5c --- /dev/null +++ b/demo/auto-plugin-use-template/dist-js-prod/common.css @@ -0,0 +1,4 @@ +body { + color: red; +} + diff --git a/demo/auto-plugin-use-template/dist-js-prod/common.js b/demo/auto-plugin-use-template/dist-js-prod/common.js new file mode 100644 index 0000000..8e59f55 --- /dev/null +++ b/demo/auto-plugin-use-template/dist-js-prod/common.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[function(o,n,i){},function(o,n){console.error("this dir should be ingore by AutoWebPlugin")}]]); \ No newline at end of file diff --git a/demo/auto-plugin-use-template/dist-js-prod/home.css b/demo/auto-plugin-use-template/dist-js-prod/home.css new file mode 100644 index 0000000..12f7b21 --- /dev/null +++ b/demo/auto-plugin-use-template/dist-js-prod/home.css @@ -0,0 +1,4 @@ +body { + background-color: red; +} + diff --git a/demo/auto-plugin-use-template/dist-js-prod/home.html b/demo/auto-plugin-use-template/dist-js-prod/home.html new file mode 100644 index 0000000..e502245 --- /dev/null +++ b/demo/auto-plugin-use-template/dist-js-prod/home.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/demo/auto-plugin-use-template/dist-js-prod/home.js b/demo/auto-plugin-use-template/dist-js-prod/home.js new file mode 100644 index 0000000..27660d9 --- /dev/null +++ b/demo/auto-plugin-use-template/dist-js-prod/home.js @@ -0,0 +1 @@ +!function(e){function n(n){for(var r,f,i=n[0],l=n[1],c=n[2],a=0,s=[];a + + + + + + + + + + + + + + + + + + diff --git a/demo/auto-plugin-use-template/dist-js-prod/login.js b/demo/auto-plugin-use-template/dist-js-prod/login.js new file mode 100644 index 0000000..33cf076 --- /dev/null +++ b/demo/auto-plugin-use-template/dist-js-prod/login.js @@ -0,0 +1 @@ +!function(e){function n(n){for(var r,i,f=n[0],l=n[1],c=n[2],a=0,s=[];a + + + + + + + + + + + + + + + + + + diff --git a/demo/auto-plugin-use-template/dist-js-prod/signup.js b/demo/auto-plugin-use-template/dist-js-prod/signup.js new file mode 100644 index 0000000..127623e --- /dev/null +++ b/demo/auto-plugin-use-template/dist-js-prod/signup.js @@ -0,0 +1 @@ +!function(e){function n(n){for(var r,i,f=n[0],l=n[1],p=n[2],a=0,s=[];a + + + + + + + + + + + diff --git a/demo/auto-plugin-use-template/dist/home.js b/demo/auto-plugin-use-template/dist/home.js new file mode 100644 index 0000000..72ff62c --- /dev/null +++ b/demo/auto-plugin-use-template/dist/home.js @@ -0,0 +1 @@ +!function(e){function n(n){for(var r,f,i=n[0],l=n[1],c=n[2],a=0,s=[];a + + + + + + + + + + + diff --git a/demo/auto-plugin-use-template/dist/login.js b/demo/auto-plugin-use-template/dist/login.js new file mode 100644 index 0000000..9ae8176 --- /dev/null +++ b/demo/auto-plugin-use-template/dist/login.js @@ -0,0 +1 @@ +!function(e){function n(n){for(var r,i,f=n[0],l=n[1],c=n[2],a=0,s=[];a + + + + + + + + + + + diff --git a/demo/auto-plugin-use-template/dist/signup.js b/demo/auto-plugin-use-template/dist/signup.js new file mode 100644 index 0000000..d880923 --- /dev/null +++ b/demo/auto-plugin-use-template/dist/signup.js @@ -0,0 +1 @@ +!function(e){function n(n){for(var r,i,f=n[0],l=n[1],p=n[2],a=0,s=[];a + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo/auto-plugin-use-template/webpack.config.js b/demo/auto-plugin-use-template/webpack.config.js new file mode 100644 index 0000000..314addd --- /dev/null +++ b/demo/auto-plugin-use-template/webpack.config.js @@ -0,0 +1,49 @@ +const path = require('path'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const { AutoWebPlugin } = require('../../index'); + +const autoWebPlugin = new AutoWebPlugin('./src/', { + ignorePages: ['ignore'], + template() { + return './src/template.html'; + }, + outputPagemap: true, +}); + +module.exports = { + output: { + path: path.resolve(__dirname, 'dist'), + filename: '[name].js', + publicPath: 'https://cdn.cn/', + }, + entry: autoWebPlugin.entry({ + ie_polyfill: './src/ie_polyfill', + polyfill: './src/polyfill', + }), + optimization: { + splitChunks: { + minSize: 0, + cacheGroups: { + commons: { + chunks: 'initial', + name: 'common', + minChunks: 2, + }, + }, + }, + }, + module: { + rules: [ + { + test: /\.css$/, + loader: [MiniCssExtractPlugin.loader, 'css-loader'], + }, + ], + }, + plugins: [ + new MiniCssExtractPlugin({ + filename: '[name].css', + }), + autoWebPlugin, + ], +}; diff --git a/package.json b/package.json index cfc844a..39f731d 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "demo:auto-plugin": "cd demo/auto-plugin && rm -rf dist && rm -rf dist-js-prod && webpack --mode development && webpack --mode production --output-path dist-js-prod && cd ../../", "demo:auto-plugin-logic-filename": "cd demo/auto-plugin-logic-filename && rm -rf dist && webpack && cd ../../", "demo:auto-plugin-react-typescript": "cd demo/auto-plugin-react-typescript && rm -rf dist && webpack && cd ../../", + "demo:auto-plugin-use-template": "cd demo/auto-plugin-use-template && rm -rf dist && webpack && cd ../../", "demo:config-resource": "cd demo/config-resource && rm -rf dist-js && rm -rf dist-js-prod && rm -rf dist-template && rm -rf dist && webpack && webpack --config webpack.config-template.js && webpack -p --output-path dist-js-prod && cd ../../", "demo:out-html": "cd demo/out-html && rm -rf dist && webpack && cd ../../", "demo:issue6": "cd demo/issue6 && rm -rf dist && webpack && cd ../../",