├── demo ├── issue6 │ ├── src │ │ ├── polyfill.js │ │ ├── home │ │ │ ├── index.css │ │ │ └── index.js │ │ ├── login │ │ │ ├── index.css │ │ │ └── index.js │ │ ├── signup │ │ │ ├── index.css │ │ │ └── index.js │ │ └── template.ejs │ ├── dist │ │ ├── home.css │ │ ├── login.css │ │ ├── signup.css │ │ ├── polyfill.js │ │ ├── login.js │ │ ├── signup.js │ │ ├── home.js │ │ ├── home.html │ │ ├── login.html │ │ └── signup.html │ ├── README.md │ └── webpack.config.js ├── load-local-file │ ├── jquery.js │ ├── dist │ │ ├── jquery.js │ │ ├── ie-polyfill.js │ │ ├── img.png │ │ ├── README.md │ │ └── A.js │ ├── ie-polyfill.js │ ├── dist-prod │ │ ├── jquery.js │ │ ├── ie-polyfill.js │ │ ├── img.png │ │ ├── README.md │ │ └── A_ae7690b3d3399e308cf1.js │ ├── reset.css │ ├── a.js │ ├── img.png │ ├── webpack.config.js │ ├── webpack-prod.config.js │ └── README.md ├── auto-plugin │ ├── src │ │ ├── polyfill.js │ │ ├── ie_polyfill.js │ │ ├── ignore │ │ │ ├── index.css │ │ │ └── index.js │ │ ├── home │ │ │ ├── index.css │ │ │ └── index.js │ │ ├── login │ │ │ ├── index.css │ │ │ └── index.js │ │ ├── signup │ │ │ ├── index.css │ │ │ └── index.js │ │ └── template.html │ ├── dist │ │ ├── common.css │ │ ├── home.css │ │ ├── login.css │ │ ├── signup.css │ │ ├── pagemap.json │ │ ├── home.html │ │ ├── login.html │ │ ├── signup.html │ │ ├── common.js │ │ ├── polyfill.js │ │ └── ie_polyfill.js │ ├── dist-js-prod │ │ ├── common.css │ │ ├── home.css │ │ ├── login.css │ │ ├── signup.css │ │ ├── common.js │ │ ├── pagemap.json │ │ ├── home.html │ │ ├── login.html │ │ ├── signup.html │ │ ├── polyfill.js │ │ ├── ie_polyfill.js │ │ ├── home.js │ │ ├── login.js │ │ └── signup.js │ ├── webpack.config.js │ └── README.md ├── use-template │ ├── google-analyze.js │ ├── dist │ │ ├── google-analyze.js │ │ ├── index.html │ │ ├── A.js │ │ └── B.js │ ├── a.js │ ├── b.js │ ├── reset.min.css │ ├── webpack.config.js │ ├── template.html │ └── README.md ├── config-resource │ ├── google-analytics.js │ ├── dist-js-prod │ │ ├── google-analytics.js │ │ ├── googleAnalytics.js │ │ ├── dev.js │ │ ├── ie-polyfill.js │ │ ├── inline.js │ │ └── index.html │ ├── dev.js │ ├── ie-polyfill.js │ ├── inline.js │ ├── dist-js │ │ ├── index.html │ │ ├── googleAnalytics.js │ │ ├── dev.js │ │ ├── ie-polyfill.js │ │ └── inline.js │ ├── template.html │ ├── webpack.config-template.js │ ├── webpack.config.js │ ├── dist-template │ │ ├── googleAnalytics.js │ │ ├── dev.js │ │ ├── ie-polyfill.js │ │ ├── inline.js │ │ └── index.html │ └── README.md ├── pre-post-entrys │ ├── polyfill.js │ ├── pages │ │ └── page1 │ │ │ └── index.js │ ├── google-analytics.js │ ├── dist │ │ ├── page1.html │ │ ├── polyfill.js │ │ ├── google-analytics.js │ │ └── page1.js │ └── webpack.config.js ├── use-template-complier │ ├── footer.ejs │ ├── google-analyze.js │ ├── dist │ │ ├── google-analyze.js │ │ ├── a.html │ │ ├── b.html │ │ ├── a.js │ │ └── b.js │ ├── pages │ │ ├── a │ │ │ └── index.js │ │ └── b │ │ │ └── index.js │ ├── reset.min.css │ ├── template.ejs │ ├── README.md │ └── webpack.config.js ├── watch-template │ ├── README.md │ ├── google-analyze.js │ ├── dist │ │ ├── google-analyze.js │ │ ├── index.html │ │ ├── A.js │ │ └── B.js │ ├── a.js │ ├── b.js │ ├── reset.min.css │ ├── webpack.config.js │ └── template.html ├── config-html-attribute │ ├── google-analyze.js │ ├── dist │ │ ├── google-analyze.js │ │ ├── index.html │ │ ├── A.js │ │ └── B.js │ ├── a.js │ ├── b.js │ ├── reset.min.css │ ├── webpack.config.js │ ├── template.html │ └── README.md ├── out-pagemap │ ├── a.js │ ├── b.js │ ├── dist │ │ ├── pagemap.json │ │ ├── index.html │ │ ├── A.js │ │ └── B.js │ └── webpack.config.js ├── public-path │ ├── a.css │ ├── b.css │ ├── dist │ │ ├── A.css │ │ ├── B.css │ │ ├── index.html │ │ ├── A.js │ │ └── B.js │ ├── a.js │ ├── b.js │ ├── template.html │ ├── README.md │ └── webpack.config.js ├── auto-plugin-logic-filename │ ├── src │ │ ├── home │ │ │ └── index.js │ │ ├── login │ │ │ └── index.js │ │ └── signup │ │ │ └── index.js │ ├── dist │ │ ├── home++.html │ │ ├── login++.html │ │ ├── signup++.html │ │ ├── home.js │ │ ├── login.js │ │ └── signup.js │ ├── README.md │ └── webpack.config.js ├── extract-css │ ├── 3.css │ ├── 1.css │ ├── 1.js │ ├── 2.js │ ├── 3.js │ ├── 4.js │ ├── dist │ │ ├── 3.css │ │ ├── 1.css │ │ ├── 4.css │ │ ├── 2.css │ │ ├── index.html │ │ ├── 1.js │ │ ├── 2.js │ │ ├── 3.js │ │ └── 4.js │ ├── 4.css │ ├── 2.css │ ├── template.html │ ├── webpack.config.js │ └── README.md ├── out-html │ ├── a.js │ ├── b.js │ ├── dist │ │ ├── a.html │ │ ├── b.html │ │ ├── A.js │ │ └── B.js │ └── webpack.config.js ├── relative-path │ ├── a.css │ ├── b.css │ ├── dist │ │ ├── A.css │ │ ├── B.css │ │ ├── math.png │ │ ├── README.md │ │ ├── img │ │ │ └── resume_c527df321483df995119f1cfa5ccbcf8.pdf │ │ ├── html │ │ │ └── index.html │ │ └── js │ │ │ ├── B.js │ │ │ └── A.js │ ├── b.js │ ├── math.png │ ├── resume.pdf │ ├── a.js │ ├── README.md │ ├── template.html │ └── webpack.config.js ├── relative-path-public-path │ ├── a.css │ ├── b.css │ ├── dist │ │ ├── A.css │ │ ├── B.css │ │ ├── math.png │ │ ├── README.md │ │ ├── img │ │ │ └── resume_c527df321483df995119f1cfa5ccbcf8.pdf │ │ ├── html │ │ │ └── index.html │ │ └── js │ │ │ ├── B.js │ │ │ └── A.js │ ├── b.js │ ├── a.js │ ├── math.png │ ├── resume.pdf │ ├── README.md │ ├── template.html │ └── webpack.config.js ├── mutil-web-plugin │ ├── src │ │ ├── home │ │ │ ├── index.css │ │ │ └── index.js │ │ ├── login │ │ │ ├── index.css │ │ │ └── index.js │ │ └── template.html │ ├── dist │ │ ├── pagemap.json │ │ ├── home.html │ │ └── login.html │ ├── README.md │ └── webpack.config.js ├── auto-plugin-pagedir-object │ ├── dist │ │ ├── home.css │ │ ├── login.css │ │ ├── pagemap.json │ │ ├── home.html │ │ ├── login.html │ │ ├── home.js │ │ └── login.js │ ├── src │ │ ├── home │ │ │ ├── index.css │ │ │ └── index.js │ │ ├── login │ │ │ ├── index.css │ │ │ └── index.js │ │ └── template.html │ ├── README.md │ └── webpack.config.js ├── auto-plugin-react-typescript │ ├── src │ │ ├── pages │ │ │ ├── home │ │ │ │ ├── index.css │ │ │ │ └── index.tsx │ │ │ ├── login │ │ │ │ ├── index.css │ │ │ │ └── index.tsx │ │ │ └── signup │ │ │ │ ├── index.css │ │ │ │ └── index.tsx │ │ ├── base.ts │ │ ├── components │ │ │ └── Button │ │ │ │ ├── index.css │ │ │ │ └── index.tsx │ │ └── template.html │ ├── dist │ │ ├── home.bdfa83d7c28701ba11a2.css │ │ ├── login.0cf2ad5162d36b74d1bc.css │ │ ├── signup.1912ed415c0c65795aa6.css │ │ ├── common.eee366c84be3ae357bd1.css │ │ ├── common.265b1c1247739909f9f3.js │ │ ├── home.87d641acdc6b2f120dce.js │ │ ├── login.4293fb994102c1c5ef89.js │ │ └── signup.1845e32ed5ae26cd164c.js │ ├── tsconfig.json │ ├── webpack.config.js │ └── README.md ├── hmr │ ├── a │ │ ├── index.css │ │ └── index.js │ ├── pages │ │ └── b │ │ │ ├── index.css │ │ │ └── index.js │ ├── template.html │ ├── dist │ │ ├── a.html │ │ └── b.html │ └── webpack.config.js └── minify-html │ ├── a.js │ ├── reset.min.css │ ├── README.md │ ├── template.html │ ├── webpack.config.js │ └── dist │ ├── A.js │ └── index.html ├── .travis.yml ├── .gitignore ├── .prettierrc ├── .editorconfig ├── index.js ├── .npmignore ├── .eslintrc.js ├── test.js └── package.json /demo/issue6/src/polyfill.js: -------------------------------------------------------------------------------- 1 | alert('polyfill'); 2 | -------------------------------------------------------------------------------- /demo/load-local-file/jquery.js: -------------------------------------------------------------------------------- 1 | console.log('jq'); 2 | -------------------------------------------------------------------------------- /demo/auto-plugin/src/polyfill.js: -------------------------------------------------------------------------------- 1 | alert('polyfill'); 2 | -------------------------------------------------------------------------------- /demo/load-local-file/dist/jquery.js: -------------------------------------------------------------------------------- 1 | console.log('jq'); 2 | -------------------------------------------------------------------------------- /demo/load-local-file/ie-polyfill.js: -------------------------------------------------------------------------------- 1 | console.log('ie'); 2 | -------------------------------------------------------------------------------- /demo/use-template/google-analyze.js: -------------------------------------------------------------------------------- 1 | console.log('GA'); 2 | -------------------------------------------------------------------------------- /demo/auto-plugin/src/ie_polyfill.js: -------------------------------------------------------------------------------- 1 | alert('ie_polyfill'); 2 | -------------------------------------------------------------------------------- /demo/config-resource/google-analytics.js: -------------------------------------------------------------------------------- 1 | console.log('GA'); 2 | -------------------------------------------------------------------------------- /demo/load-local-file/dist-prod/jquery.js: -------------------------------------------------------------------------------- 1 | console.log('jq'); 2 | -------------------------------------------------------------------------------- /demo/load-local-file/dist/ie-polyfill.js: -------------------------------------------------------------------------------- 1 | console.log('ie'); 2 | -------------------------------------------------------------------------------- /demo/pre-post-entrys/polyfill.js: -------------------------------------------------------------------------------- 1 | console.log('polyfill'); 2 | -------------------------------------------------------------------------------- /demo/use-template-complier/footer.ejs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/use-template/dist/google-analyze.js: -------------------------------------------------------------------------------- 1 | console.log('GA'); 2 | -------------------------------------------------------------------------------- /demo/watch-template/README.md: -------------------------------------------------------------------------------- 1 | # 编辑 HTML 模版时,监听模式下会自动编译和刷新 2 | -------------------------------------------------------------------------------- /demo/watch-template/google-analyze.js: -------------------------------------------------------------------------------- 1 | console.log('GA'); 2 | -------------------------------------------------------------------------------- /demo/config-html-attribute/google-analyze.js: -------------------------------------------------------------------------------- 1 | console.log('GA'); 2 | -------------------------------------------------------------------------------- /demo/load-local-file/dist-prod/ie-polyfill.js: -------------------------------------------------------------------------------- 1 | console.log('ie'); 2 | -------------------------------------------------------------------------------- /demo/out-pagemap/a.js: -------------------------------------------------------------------------------- 1 | alert('hello web-webpack-plugin from a'); 2 | -------------------------------------------------------------------------------- /demo/out-pagemap/b.js: -------------------------------------------------------------------------------- 1 | alert('hello web-webpack-plugin from b'); 2 | -------------------------------------------------------------------------------- /demo/pre-post-entrys/pages/page1/index.js: -------------------------------------------------------------------------------- 1 | console.log('page1'); 2 | -------------------------------------------------------------------------------- /demo/public-path/a.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /demo/public-path/b.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #000; 3 | } 4 | -------------------------------------------------------------------------------- /demo/use-template-complier/google-analyze.js: -------------------------------------------------------------------------------- 1 | console.log('GA'); 2 | -------------------------------------------------------------------------------- /demo/watch-template/dist/google-analyze.js: -------------------------------------------------------------------------------- 1 | console.log('GA'); 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | language: node_js 3 | node_js: 4 | - "6" -------------------------------------------------------------------------------- /demo/auto-plugin-logic-filename/src/home/index.js: -------------------------------------------------------------------------------- 1 | alert('page home'); 2 | -------------------------------------------------------------------------------- /demo/auto-plugin/dist/common.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: red; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin/src/ignore/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /demo/config-html-attribute/dist/google-analyze.js: -------------------------------------------------------------------------------- 1 | console.log('GA'); 2 | -------------------------------------------------------------------------------- /demo/extract-css/3.css: -------------------------------------------------------------------------------- 1 | /*3.css*/ 2 | body { 3 | color: aqua; 4 | } 5 | -------------------------------------------------------------------------------- /demo/out-html/a.js: -------------------------------------------------------------------------------- 1 | alert('hello web-webpack-plugin from' + NAME); 2 | -------------------------------------------------------------------------------- /demo/out-html/b.js: -------------------------------------------------------------------------------- 1 | alert('hello web-webpack-plugin from' + NAME); 2 | -------------------------------------------------------------------------------- /demo/relative-path/a.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /demo/relative-path/b.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #000; 3 | } 4 | -------------------------------------------------------------------------------- /demo/use-template-complier/dist/google-analyze.js: -------------------------------------------------------------------------------- 1 | console.log('GA'); 2 | -------------------------------------------------------------------------------- /demo/use-template/a.js: -------------------------------------------------------------------------------- 1 | console.lo('hello web-webpack-plugin from a'); 2 | -------------------------------------------------------------------------------- /demo/auto-plugin-logic-filename/src/login/index.js: -------------------------------------------------------------------------------- 1 | alert('page login'); 2 | -------------------------------------------------------------------------------- /demo/auto-plugin-logic-filename/src/signup/index.js: -------------------------------------------------------------------------------- 1 | alert('page signup'); 2 | -------------------------------------------------------------------------------- /demo/config-resource/dist-js-prod/google-analytics.js: -------------------------------------------------------------------------------- 1 | console.log('GA'); 2 | -------------------------------------------------------------------------------- /demo/extract-css/1.css: -------------------------------------------------------------------------------- 1 | /*1.css*/ 2 | body { 3 | font-size: 50px; 4 | } 5 | -------------------------------------------------------------------------------- /demo/extract-css/1.js: -------------------------------------------------------------------------------- 1 | require('./1.css'); 2 | console.log('module 1'); 3 | -------------------------------------------------------------------------------- /demo/extract-css/2.js: -------------------------------------------------------------------------------- 1 | require('./2.css'); 2 | console.log('module 2'); 3 | -------------------------------------------------------------------------------- /demo/extract-css/3.js: -------------------------------------------------------------------------------- 1 | require('./3.css'); 2 | console.log('module 3'); 3 | -------------------------------------------------------------------------------- /demo/extract-css/4.js: -------------------------------------------------------------------------------- 1 | require('./4.css'); 2 | console.log('module 4'); 3 | -------------------------------------------------------------------------------- /demo/issue6/dist/home.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/issue6/dist/login.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/issue6/src/home/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } 4 | -------------------------------------------------------------------------------- /demo/issue6/src/login/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /demo/load-local-file/reset.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } 4 | -------------------------------------------------------------------------------- /demo/pre-post-entrys/google-analytics.js: -------------------------------------------------------------------------------- 1 | console.log('google-analytics'); 2 | -------------------------------------------------------------------------------- /demo/public-path/dist/A.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/public-path/dist/B.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #000; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/use-template/b.js: -------------------------------------------------------------------------------- 1 | console.log('hello web-webpack-plugin from b'); 2 | -------------------------------------------------------------------------------- /demo/watch-template/a.js: -------------------------------------------------------------------------------- 1 | console.lo('hello web-webpack-plugin from a'); 2 | -------------------------------------------------------------------------------- /demo/watch-template/b.js: -------------------------------------------------------------------------------- 1 | console.log('hello web-webpack-plugin from b'); 2 | -------------------------------------------------------------------------------- /demo/auto-plugin/dist-js-prod/common.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: red; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin/dist/home.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin/dist/login.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin/src/home/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } 4 | -------------------------------------------------------------------------------- /demo/auto-plugin/src/login/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /demo/config-html-attribute/a.js: -------------------------------------------------------------------------------- 1 | console.lo('hello web-webpack-plugin from a'); 2 | -------------------------------------------------------------------------------- /demo/config-html-attribute/b.js: -------------------------------------------------------------------------------- 1 | console.log('hello web-webpack-plugin from b'); 2 | -------------------------------------------------------------------------------- /demo/config-resource/dev.js: -------------------------------------------------------------------------------- 1 | alert('this script will only load in dev mode'); 2 | -------------------------------------------------------------------------------- /demo/config-resource/ie-polyfill.js: -------------------------------------------------------------------------------- 1 | alert('only IE will load this script'); 2 | -------------------------------------------------------------------------------- /demo/extract-css/dist/3.css: -------------------------------------------------------------------------------- 1 | /*3.css*/ 2 | body { 3 | color: aqua; 4 | } 5 | 6 | -------------------------------------------------------------------------------- /demo/issue6/dist/signup.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: yellow; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/issue6/src/home/index.js: -------------------------------------------------------------------------------- 1 | require('./index.css'); 2 | alert('page home'); 3 | -------------------------------------------------------------------------------- /demo/issue6/src/login/index.js: -------------------------------------------------------------------------------- 1 | require('./index.css'); 2 | alert('page login'); 3 | -------------------------------------------------------------------------------- /demo/issue6/src/signup/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: yellow; 3 | } 4 | -------------------------------------------------------------------------------- /demo/load-local-file/a.js: -------------------------------------------------------------------------------- 1 | console.log('module A load from web-webpack-plugin'); 2 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/a.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/b.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #000; 3 | } 4 | -------------------------------------------------------------------------------- /demo/relative-path/dist/A.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/relative-path/dist/B.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #000; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin/dist-js-prod/home.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin/dist/signup.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: yellow; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin/src/signup/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: yellow; 3 | } 4 | -------------------------------------------------------------------------------- /demo/config-resource/inline.js: -------------------------------------------------------------------------------- 1 | alert('this script will be inject into html inline'); 2 | -------------------------------------------------------------------------------- /demo/extract-css/4.css: -------------------------------------------------------------------------------- 1 | /*4.css*/ 2 | body { 3 | border: 10px solid black; 4 | } 5 | -------------------------------------------------------------------------------- /demo/extract-css/dist/1.css: -------------------------------------------------------------------------------- 1 | /*1.css*/ 2 | body { 3 | font-size: 50px; 4 | } 5 | 6 | -------------------------------------------------------------------------------- /demo/issue6/src/signup/index.js: -------------------------------------------------------------------------------- 1 | require('./index.css'); 2 | alert('page signup'); 3 | -------------------------------------------------------------------------------- /demo/mutil-web-plugin/src/home/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } 4 | -------------------------------------------------------------------------------- /demo/mutil-web-plugin/src/login/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /demo/use-template/reset.min.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: rebeccapurple; 3 | } 4 | -------------------------------------------------------------------------------- /demo/watch-template/reset.min.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: rebeccapurple; 3 | } 4 | -------------------------------------------------------------------------------- /demo/auto-plugin/dist-js-prod/login.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin/dist-js-prod/signup.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: yellow; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/extract-css/2.css: -------------------------------------------------------------------------------- 1 | /*2.css*/ 2 | body { 3 | background-color: rebeccapurple; 4 | } 5 | -------------------------------------------------------------------------------- /demo/mutil-web-plugin/src/home/index.js: -------------------------------------------------------------------------------- 1 | require('./index.css'); 2 | alert('page home'); 3 | -------------------------------------------------------------------------------- /demo/mutil-web-plugin/src/login/index.js: -------------------------------------------------------------------------------- 1 | require('./index.css'); 2 | alert('page login'); 3 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/dist/A.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fff; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/dist/B.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #000; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin-pagedir-object/dist/home.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin-pagedir-object/dist/login.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin-pagedir-object/src/home/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } 4 | -------------------------------------------------------------------------------- /demo/auto-plugin-pagedir-object/src/login/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /demo/config-html-attribute/reset.min.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: rebeccapurple; 3 | } 4 | -------------------------------------------------------------------------------- /demo/extract-css/dist/4.css: -------------------------------------------------------------------------------- 1 | /*4.css*/ 2 | body { 3 | border: 10px solid black; 4 | } 5 | 6 | -------------------------------------------------------------------------------- /demo/public-path/a.js: -------------------------------------------------------------------------------- 1 | console.lo('hello web-webpack-plugin from a'); 2 | require('./a.css'); 3 | -------------------------------------------------------------------------------- /demo/public-path/b.js: -------------------------------------------------------------------------------- 1 | console.log('hello web-webpack-plugin from b'); 2 | require('./b.css'); 3 | -------------------------------------------------------------------------------- /demo/use-template-complier/pages/a/index.js: -------------------------------------------------------------------------------- 1 | console.lo('hello web-webpack-plugin from a'); 2 | -------------------------------------------------------------------------------- /demo/use-template-complier/pages/b/index.js: -------------------------------------------------------------------------------- 1 | console.log('hello web-webpack-plugin from b'); 2 | -------------------------------------------------------------------------------- /demo/use-template-complier/reset.min.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: rebeccapurple; 3 | } 4 | -------------------------------------------------------------------------------- /demo/auto-plugin-pagedir-object/src/home/index.js: -------------------------------------------------------------------------------- 1 | require('./index.css'); 2 | alert('page home'); 3 | -------------------------------------------------------------------------------- /demo/auto-plugin-pagedir-object/src/login/index.js: -------------------------------------------------------------------------------- 1 | require('./index.css'); 2 | alert('page login'); 3 | -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/src/pages/home/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } 4 | -------------------------------------------------------------------------------- /demo/auto-plugin/src/ignore/index.js: -------------------------------------------------------------------------------- 1 | console.error('this dir should be ingore by AutoWebPlugin'); 2 | -------------------------------------------------------------------------------- /demo/extract-css/dist/2.css: -------------------------------------------------------------------------------- 1 | /*2.css*/ 2 | body { 3 | background-color: rebeccapurple; 4 | } 5 | 6 | -------------------------------------------------------------------------------- /demo/relative-path/b.js: -------------------------------------------------------------------------------- 1 | console.log('hello web-webpack-plugin from b'); 2 | require('./b.css'); 3 | -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/src/base.ts: -------------------------------------------------------------------------------- 1 | import 'tslib'; 2 | import 'react'; 3 | import 'react-dom'; -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/src/pages/login/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/src/pages/signup/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: yellow; 3 | } 4 | -------------------------------------------------------------------------------- /demo/issue6/README.md: -------------------------------------------------------------------------------- 1 | # answer for [issue6](https://github.com/gwuhaolin/web-webpack-plugin/issues/6) 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | .idea/ 3 | node_modules 4 | package-lock.json 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "es5", 4 | "arrowParens": "always" 5 | } 6 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/b.js: -------------------------------------------------------------------------------- 1 | console.log('hello web-webpack-plugin from b'); 2 | require('./b.css'); 3 | -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/dist/home.bdfa83d7c28701ba11a2.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: red; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/hmr/a/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | text-align: center; 3 | color: lawngreen; 4 | background-color: black; 5 | } 6 | -------------------------------------------------------------------------------- /demo/out-pagemap/dist/pagemap.json: -------------------------------------------------------------------------------- 1 | {"publicPath":"","js":["B.js"],"css":[],"html":"index.html.html","version":"1.2.3"} -------------------------------------------------------------------------------- /demo/relative-path/math.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwuhaolin/web-webpack-plugin/HEAD/demo/relative-path/math.png -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | charset=utf-8 3 | end_of_line=lf 4 | insert_final_newline=false 5 | indent_style=tab 6 | indent_size=2 -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/dist/login.0cf2ad5162d36b74d1bc.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: blue; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/dist/signup.1912ed415c0c65795aa6.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: yellow; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /demo/hmr/pages/b/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | text-align: center; 3 | color: lawngreen; 4 | background-color: black; 5 | } 6 | -------------------------------------------------------------------------------- /demo/load-local-file/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwuhaolin/web-webpack-plugin/HEAD/demo/load-local-file/img.png -------------------------------------------------------------------------------- /demo/relative-path/resume.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwuhaolin/web-webpack-plugin/HEAD/demo/relative-path/resume.pdf -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | exports.WebPlugin = require('./lib/WebPlugin'); 2 | exports.AutoWebPlugin = require('./lib/AutoWebPlugin'); 3 | -------------------------------------------------------------------------------- /demo/relative-path/a.js: -------------------------------------------------------------------------------- 1 | console.lo('hello web-webpack-plugin from a'); 2 | require('./a.css'); 3 | require('./resume.pdf'); 4 | -------------------------------------------------------------------------------- /demo/relative-path/dist/math.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwuhaolin/web-webpack-plugin/HEAD/demo/relative-path/dist/math.png -------------------------------------------------------------------------------- /demo/load-local-file/dist/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwuhaolin/web-webpack-plugin/HEAD/demo/load-local-file/dist/img.png -------------------------------------------------------------------------------- /demo/minify-html/a.js: -------------------------------------------------------------------------------- 1 | function f(x) { 2 | console.log(x); 3 | } 4 | 5 | let x = 'hello web-webpack-plugin from a'; 6 | 7 | f(x); 8 | -------------------------------------------------------------------------------- /demo/mutil-web-plugin/dist/pagemap.json: -------------------------------------------------------------------------------- 1 | {"publicPath":"https://cdn.cn/","js":[],"css":[],"asyncJs":[],"asyncCss":[],"html":"home.html"}} -------------------------------------------------------------------------------- /demo/load-local-file/dist-prod/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwuhaolin/web-webpack-plugin/HEAD/demo/load-local-file/dist-prod/img.png -------------------------------------------------------------------------------- /demo/relative-path-public-path/a.js: -------------------------------------------------------------------------------- 1 | console.lo('hello web-webpack-plugin from a'); 2 | require('./a.css'); 3 | require('./resume.pdf'); 4 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/math.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwuhaolin/web-webpack-plugin/HEAD/demo/relative-path-public-path/math.png -------------------------------------------------------------------------------- /demo/relative-path/README.md: -------------------------------------------------------------------------------- 1 | # calculate relative paths 2 | 3 | see [this issue](https://github.com/gwuhaolin/web-webpack-plugin/issues/4) 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | demo 3 | .idea 4 | .editorconfig 5 | .eslintrc.js 6 | .gitignore 7 | .travis.yml 8 | -------------------------------------------------------------------------------- /demo/auto-plugin/src/home/index.js: -------------------------------------------------------------------------------- 1 | require('./index.css'); 2 | require('../ignore'); 3 | require('../ignore/index.css'); 4 | alert('page home'); 5 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/resume.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwuhaolin/web-webpack-plugin/HEAD/demo/relative-path-public-path/resume.pdf -------------------------------------------------------------------------------- /demo/relative-path/dist/README.md: -------------------------------------------------------------------------------- 1 | # calculate relative paths 2 | 3 | see [this issue](https://github.com/gwuhaolin/web-webpack-plugin/issues/4) 4 | -------------------------------------------------------------------------------- /demo/auto-plugin/src/login/index.js: -------------------------------------------------------------------------------- 1 | require('./index.css'); 2 | require('../ignore'); 3 | require('../ignore/index.css'); 4 | alert('page login'); 5 | -------------------------------------------------------------------------------- /demo/auto-plugin/src/signup/index.js: -------------------------------------------------------------------------------- 1 | require('./index.css'); 2 | require('../ignore'); 3 | require('../ignore/index.css'); 4 | alert('page signup'); 5 | -------------------------------------------------------------------------------- /demo/minify-html/reset.min.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: rebeccapurple; 3 | } 4 | 5 | a { 6 | margin: 0; 7 | background-color: #ffffff; 8 | } 9 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/dist/math.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwuhaolin/web-webpack-plugin/HEAD/demo/relative-path-public-path/dist/math.png -------------------------------------------------------------------------------- /demo/hmr/a/index.js: -------------------------------------------------------------------------------- 1 | let app = window.document.getElementById('app'); 2 | app.innerHTML = 'hello A '; 3 | require('./index.css'); 4 | module.hot.accept(); 5 | -------------------------------------------------------------------------------- /demo/hmr/pages/b/index.js: -------------------------------------------------------------------------------- 1 | let app = window.document.getElementById('app'); 2 | app.innerHTML = 'hello B'; 3 | require('./index.css'); 4 | module.hot.accept(); 5 | -------------------------------------------------------------------------------- /demo/hmr/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/README.md: -------------------------------------------------------------------------------- 1 | # calculate relative paths(with publicPath) 2 | 3 | see [this issue](https://github.com/gwuhaolin/web-webpack-plugin/issues/4) 4 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/dist/README.md: -------------------------------------------------------------------------------- 1 | # calculate relative paths(with publicPath) 2 | 3 | see [this issue](https://github.com/gwuhaolin/web-webpack-plugin/issues/4) 4 | -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/src/components/Button/index.css: -------------------------------------------------------------------------------- 1 | .button-component { 2 | background-color: yellow; 3 | color: black; 4 | border-color: red; 5 | padding: 10px; 6 | } 7 | -------------------------------------------------------------------------------- /demo/auto-plugin/dist-js-prod/common.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[0],[function(o,n,i){},function(o,n){console.error("this dir should be ingore by AutoWebPlugin")}]]); -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/dist/common.eee366c84be3ae357bd1.css: -------------------------------------------------------------------------------- 1 | .button-component { 2 | background-color: yellow; 3 | color: black; 4 | border-color: red; 5 | padding: 10px; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /demo/out-html/dist/a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/out-html/dist/b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/relative-path/dist/img/resume_c527df321483df995119f1cfa5ccbcf8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwuhaolin/web-webpack-plugin/HEAD/demo/relative-path/dist/img/resume_c527df321483df995119f1cfa5ccbcf8.pdf -------------------------------------------------------------------------------- /demo/hmr/dist/a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/hmr/dist/b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/pre-post-entrys/dist/page1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "env": { 3 | "node": true, 4 | "commonjs": true, 5 | "es6": true 6 | }, 7 | "extends": "eslint:recommended", 8 | "parserOptions": { 9 | "ecmaVersion": 9 10 | } 11 | }; -------------------------------------------------------------------------------- /demo/auto-plugin-logic-filename/dist/home++.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/dist/img/resume_c527df321483df995119f1cfa5ccbcf8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwuhaolin/web-webpack-plugin/HEAD/demo/relative-path-public-path/dist/img/resume_c527df321483df995119f1cfa5ccbcf8.pdf -------------------------------------------------------------------------------- /demo/auto-plugin-logic-filename/dist/login++.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/auto-plugin-logic-filename/dist/signup++.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/out-pagemap/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es5", 5 | "sourceMap": true, 6 | "jsx": "react", 7 | "importHelpers": true 8 | }, 9 | "exclude": ["node_modules"] 10 | } 11 | -------------------------------------------------------------------------------- /demo/minify-html/README.md: -------------------------------------------------------------------------------- 1 | # 压缩输出的 HTML 2 | 3 | ```js 4 | const { minify } = require('html-minifier'); 5 | new WebPlugin({ 6 | htmlMinify: (orgHTML) => { 7 | return minify(orgHTML, { 8 | minifyJS: true, 9 | }); 10 | }, 11 | }); 12 | ``` 13 | -------------------------------------------------------------------------------- /demo/auto-plugin-pagedir-object/dist/pagemap.json: -------------------------------------------------------------------------------- 1 | {"home":{"publicPath":"https://cdn.cn/","js":["home.js"],"css":["home.css"],"asyncJs":[],"asyncCss":[],"html":"home.html"},"login":{"publicPath":"https://cdn.cn/","js":["login.js"],"css":["login.css"],"asyncJs":[],"asyncCss":[],"html":"login.html"}} -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/src/components/Button/index.tsx: -------------------------------------------------------------------------------- 1 | import { Component } from 'react'; 2 | import * as React from 'react'; 3 | import './index.css'; 4 | 5 | export class Button extends Component { 6 | render() { 7 | return
14 | readme
15 |
16 |
--------------------------------------------------------------------------------
/demo/watch-template/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { WebPlugin } = require('../../index');
3 |
4 | module.exports = {
5 | output: {
6 | path: path.resolve(__dirname, 'dist'),
7 | filename: '[name].js',
8 | },
9 | entry: {
10 | A: './a',
11 | B: './b',
12 | },
13 | plugins: [
14 | new WebPlugin({
15 | filename: 'index.html',
16 | template: './template.html',
17 | requires: ['A', 'B'],
18 | }),
19 | ],
20 | };
21 |
--------------------------------------------------------------------------------
/demo/config-html-attribute/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { WebPlugin } = require('../../index');
3 |
4 | module.exports = {
5 | output: {
6 | path: path.resolve(__dirname, 'dist'),
7 | filename: '[name].js',
8 | },
9 | entry: {
10 | A: './a',
11 | B: './b',
12 | },
13 | plugins: [
14 | new WebPlugin({
15 | filename: 'index.html',
16 | template: './template.html',
17 | requires: ['A', 'B'],
18 | }),
19 | ],
20 | };
21 |
--------------------------------------------------------------------------------
/demo/load-local-file/webpack-prod.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { WebPlugin } = require('../../index');
3 |
4 | module.exports = {
5 | output: {
6 | path: path.resolve(__dirname, 'dist'),
7 | filename: '[name]_[chunkhash].js',
8 | publicPath: '//cdn.cn/web',
9 | },
10 | entry: {
11 | A: './a',
12 | },
13 | plugins: [
14 | new WebPlugin({
15 | filename: 'index.html',
16 | template: './template.html',
17 | }),
18 | ],
19 | };
20 |
--------------------------------------------------------------------------------
/demo/auto-plugin-react-typescript/src/pages/home/index.tsx:
--------------------------------------------------------------------------------
1 | import { Component } from 'react';
2 | import * as React from 'react';
3 | import { render } from 'react-dom';
4 | import { Button } from '../../components/Button';
5 | import './index.css';
6 |
7 | class PageHome extends Component {
8 | render() {
9 | return (
10 |
14 | readme
15 |
16 |
--------------------------------------------------------------------------------
/demo/auto-plugin-pagedir-object/dist/home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/demo/auto-plugin-pagedir-object/dist/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/demo/pre-post-entrys/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { AutoWebPlugin } = require('../../index');
3 |
4 | module.exports = {
5 | output: {
6 | path: path.resolve(__dirname, 'dist'),
7 | filename: '[name].js',
8 | },
9 | entry: {
10 | polyfill: './polyfill',
11 | 'google-analytics': './google-analytics',
12 | },
13 | plugins: [
14 | new AutoWebPlugin('./pages', {
15 | preEntrys: ['./polyfill'],
16 | postEntrys: ['./google-analytics'],
17 | }),
18 | ],
19 | };
20 |
--------------------------------------------------------------------------------
/demo/out-pagemap/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { WebPlugin } = require('../../index');
3 |
4 | module.exports = {
5 | output: {
6 | path: path.resolve(__dirname, 'dist'),
7 | filename: '[name].js',
8 | },
9 | entry: {
10 | A: './a',
11 | B: './b',
12 | },
13 | plugins: [
14 | new WebPlugin({
15 | filename: 'index.html',
16 | requires: ['A', 'B'],
17 | outputPagemap: (json) => {
18 | json.version = '1.2.3';
19 | return json;
20 | },
21 | }),
22 | ],
23 | };
24 |
--------------------------------------------------------------------------------
/demo/relative-path/dist/html/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | readme
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/demo/config-resource/webpack.config-template.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { WebPlugin } = require('../../index');
3 |
4 | module.exports = {
5 | output: {
6 | path: path.resolve(__dirname, 'dist-template'),
7 | filename: '[name].js',
8 | },
9 | entry: {
10 | 'ie-polyfill': './ie-polyfill',
11 | inline: './inline',
12 | dev: './dev',
13 | googleAnalytics: './google-analytics',
14 | },
15 | plugins: [
16 | new WebPlugin({
17 | filename: 'index.html',
18 | template: './template.html',
19 | }),
20 | ],
21 | };
22 |
--------------------------------------------------------------------------------
/demo/watch-template/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/demo/relative-path-public-path/dist/html/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | readme
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/demo/minify-html/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { WebPlugin } = require('../../index');
3 | const { minify } = require('html-minifier');
4 |
5 | module.exports = {
6 | output: {
7 | path: path.resolve(__dirname, 'dist'),
8 | filename: '[name].js',
9 | },
10 | entry: {
11 | A: './a',
12 | },
13 | plugins: [
14 | new WebPlugin({
15 | filename: 'index.html',
16 | template: './template.html',
17 | htmlMinify: (orgHTML) => {
18 | return minify(orgHTML, {
19 | minifyJS: true,
20 | });
21 | },
22 | }),
23 | ],
24 | };
25 |
--------------------------------------------------------------------------------
/demo/auto-plugin-react-typescript/src/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/demo/auto-plugin/src/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/demo/extract-css/dist/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/demo/use-template/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/demo/watch-template/dist/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/test.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-console */
2 | const assert = require('assert');
3 | const { execSync, spawn } = require('child_process');
4 |
5 | const webpack = spawn('npm', ['run', 'demo']);
6 | webpack.stdout.pipe(process.stdout);
7 |
8 | webpack.on('close', (code) => {
9 | assert.equal(code, 0, '😡 webpack should run complete successful!');
10 | const change = execSync('git ls-files -dom demo').toString();
11 | assert.equal(
12 | change.length,
13 | 0,
14 | `😡 webpack compile out in demo has changed, review these files:\n${change}`
15 | );
16 | console.info('😘 webpack compile out in demo not change, test pass~');
17 | });
18 |
--------------------------------------------------------------------------------
/demo/config-html-attribute/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/demo/use-template/dist/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/demo/public-path/README.md:
--------------------------------------------------------------------------------
1 | # 设置 PublicPath
2 |
3 | 生产环境下最好把生产的 JS 和 CSS 发布到 CDN 上去,以加速你的网站加载速度。这时候你需要配置 PublicPath。
4 |
5 | * 要配置 JS 文件的 PublicPath,如下:
6 |
7 | ```js
8 | module.exports = {
9 | output: {
10 | publicPath: '//js.cdn',
11 | },
12 | };
13 | ```
14 |
15 | * 要配置 CSS 文件的 PublicPath,如下:
16 |
17 | ```js
18 | new WebPlugin({
19 | stylePublicPath: '//css.cdn',
20 | });
21 | ```
22 |
23 | * 其他资源的 PublicPath,如下:
24 |
25 | ```js
26 | {
27 | test: /\.css$/,
28 | rules:ExtractTextPlugin.extract({
29 | // 通过css加载的文件都放在9.url.cn
30 | publicPath: CND.img,
31 | fallback: 'style-loader',
32 | use: ['css-loader'],
33 | }),
34 | },
35 | ```
36 |
--------------------------------------------------------------------------------
/demo/use-template-complier/README.md:
--------------------------------------------------------------------------------
1 | # 预编译模版
2 |
3 | 在[一些场景下](https://github.com/gwuhaolin/web-webpack-plugin/issues/6),你可能需要使用模版引擎预处理模版后再交给 `web-webpack-plugin` 去处理,要使用模版引擎需要使用`templateCompiler`属性,`WebPlugin` 和 `AutoWebPlugin` 都支持,具体使用如下:
4 |
5 | ```js
6 | const autoPlugin = new AutoWebPlugin('./pages', {
7 | template: './template.ejs',
8 | // 定义一个函数,告诉你当前页面的 pageName 和 使用的模版的 文件完整路径 templateFullPath,你返回一个模版引擎处理后的HTML字符串内容。
9 | templateCompiler: function(pageName, templateFullPath) {
10 | const ejsTemplate = fs.readFileSync(templateFullPath, {
11 | encoding: 'utf8',
12 | });
13 | return ejs.render(ejsTemplate, {
14 | title: pageName,
15 | });
16 | },
17 | });
18 | ```
19 |
20 | 对于`WebPlugin`用法和`AutoWebPlugin`完全一样。
21 |
--------------------------------------------------------------------------------
/demo/config-html-attribute/dist/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/demo/use-template-complier/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const fs = require('fs');
3 | const ejs = require('ejs');
4 | const { AutoWebPlugin } = require('../../index');
5 |
6 | const autoPlugin = new AutoWebPlugin('./pages', {
7 | template: './template.ejs',
8 | templateCompiler: function(pageName, templateFullPath) {
9 | const ejsTemplate = fs.readFileSync(templateFullPath, {
10 | encoding: 'utf8',
11 | });
12 | return ejs.render(ejsTemplate, {
13 | title: pageName,
14 | filename: './template.ejs',
15 | });
16 | },
17 | });
18 |
19 | module.exports = {
20 | output: {
21 | path: path.resolve(__dirname, 'dist'),
22 | filename: '[name].js',
23 | },
24 | entry: autoPlugin.entry(),
25 | plugins: [autoPlugin],
26 | };
27 |
--------------------------------------------------------------------------------
/demo/auto-plugin/dist/home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/demo/auto-plugin/dist/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/demo/auto-plugin/dist-js-prod/home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/demo/auto-plugin/dist/signup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/demo/public-path/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3 | const { WebPlugin } = require('../../index');
4 |
5 | module.exports = {
6 | output: {
7 | path: path.resolve(__dirname, 'dist'),
8 | filename: '[name].js',
9 | publicPath: '//js.cdn',
10 | },
11 | entry: {
12 | A: './a',
13 | B: './b',
14 | },
15 | module: {
16 | rules: [
17 | {
18 | test: /\.css$/,
19 | loader: [MiniCssExtractPlugin.loader, 'css-loader'],
20 | },
21 | ],
22 | },
23 | plugins: [
24 | new MiniCssExtractPlugin({
25 | filename: '[name].css',
26 | }),
27 | new WebPlugin({
28 | filename: 'index.html',
29 | template: './template.html',
30 | stylePublicPath: '//css.cdn',
31 | }),
32 | ],
33 | };
34 |
--------------------------------------------------------------------------------
/demo/auto-plugin/dist-js-prod/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/demo/auto-plugin/dist-js-prod/signup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/demo/load-local-file/README.md:
--------------------------------------------------------------------------------
1 | # 直接注入本地文件
2 |
3 | `WebPlugin`除了可以注入 webpack 生成的 chunk 外,还可以直接读取本地文件原封不动的注入到 HTML 里去。如下:
4 |
5 | ```html
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | ```
22 |
23 | 如果资源路径类似:
24 |
25 | * `./jquery.js` 以`./` `/` `../` 这些开头的就认为是要读取本地文件
26 | * `A` 这样的直接是一个单词,就认为是 webpack chunk
27 |
28 | 同时支持 JS 和 CSS
29 |
--------------------------------------------------------------------------------
/demo/mutil-web-plugin/README.md:
--------------------------------------------------------------------------------
1 | # 管理多个单页应用
2 |
3 | `AutoWebPlugin` 可以自动管理多个单页应用。简单使用如下
4 |
5 | ```js
6 | const path = require('path');
7 | const { AutoWebPlugin } = require('../../index');
8 |
9 | const autoWebPlugin = new AutoWebPlugin({
10 | home: 'src/home',
11 | login: 'src/login',
12 | }, {
13 | ignorePages: ['ignore'],
14 | template: './src/template.html',
15 | outputPagemap: true,
16 | });
17 |
18 | module.exports = {
19 | output: {
20 | path: path.resolve(__dirname, 'dist'),
21 | filename: '[name].js',
22 | publicPath: 'https://cdn.cn/',
23 | },
24 | entry: autoWebPlugin.entry({
25 | }),
26 | module: {
27 | rules: [
28 | {
29 | test: /\.css$/,
30 | loader: [MiniCssExtractPlugin.loader, 'css-loader'],
31 | },
32 | ],
33 | },
34 | plugins: [
35 | autoWebPlugin,
36 | ],
37 | };
38 | ```
--------------------------------------------------------------------------------
/demo/extract-css/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3 | const { WebPlugin } = require('../../index');
4 |
5 | module.exports = {
6 | output: {
7 | path: path.resolve(__dirname, 'dist'),
8 | filename: '[name].js',
9 | },
10 | module: {
11 | rules: [
12 | {
13 | test: /\.css$/,
14 | loader: [MiniCssExtractPlugin.loader, 'css-loader'],
15 | },
16 | ],
17 | },
18 | entry: {
19 | 1: './1',
20 | 2: './2',
21 | 3: './3',
22 | 4: './4',
23 | },
24 | plugins: [
25 | new MiniCssExtractPlugin({
26 | filename: '[name].css',
27 | }),
28 | new WebPlugin({
29 | filename: 'index.html',
30 | template: './template.html',
31 | requires: ['1', '2', '3', '4'],
32 | }),
33 | ],
34 | mode: 'development',
35 | };
36 |
--------------------------------------------------------------------------------
/demo/hmr/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const NamedModulesPlugin = require('webpack/lib/NamedModulesPlugin');
3 | const { AutoWebPlugin, WebPlugin } = require('../../index');
4 |
5 | const autoPlugin = new AutoWebPlugin('./pages', {
6 | template: './template.html',
7 | });
8 |
9 | module.exports = {
10 | output: {
11 | path: path.resolve(__dirname, 'dist'),
12 | filename: '[name].js',
13 | },
14 | module: {
15 | rules: [
16 | {
17 | test: /\.css$/,
18 | loader: ['style-loader', 'css-loader'],
19 | },
20 | ],
21 | },
22 | entry: autoPlugin.entry({
23 | a: './a',
24 | }),
25 | plugins: [
26 | new NamedModulesPlugin(),
27 | autoPlugin,
28 | new WebPlugin({
29 | template: './template.html',
30 | filename: 'a.html',
31 | requires: ['a'],
32 | }),
33 | ],
34 | };
35 |
--------------------------------------------------------------------------------
/demo/load-local-file/dist/README.md:
--------------------------------------------------------------------------------
1 | # 直接注入本地文件
2 |
3 | `WebPlugin`除了可以注入 webpack 生成的 chunk 外,还可以直接读取本地文件原封不动的注入到 HTML 里去。如下:
4 |
5 | ```html
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | ```
22 |
23 | 如果资源路径类似:
24 |
25 | * `./jquery.js` 以`./` `/` `../` 这些开头的就认为是要读取本地文件
26 | * `A` 这样的直接是一个单词,就认为是 webpack chunk
27 |
28 | 同时支持 JS 和 CSS
29 |
--------------------------------------------------------------------------------
/demo/auto-plugin-pagedir-object/README.md:
--------------------------------------------------------------------------------
1 | # 管理多个单页应用
2 |
3 | `AutoWebPlugin` 可以自动管理多个单页应用。简单使用如下
4 |
5 | ```js
6 | const path = require('path');
7 | const { AutoWebPlugin } = require('../../index');
8 |
9 | const autoWebPlugin = new AutoWebPlugin({
10 | home: 'src/home',
11 | login: 'src/login',
12 | }, {
13 | ignorePages: ['ignore'],
14 | template: './src/template.html',
15 | outputPagemap: true,
16 | });
17 |
18 | module.exports = {
19 | output: {
20 | path: path.resolve(__dirname, 'dist'),
21 | filename: '[name].js',
22 | publicPath: 'https://cdn.cn/',
23 | },
24 | entry: autoWebPlugin.entry({
25 | }),
26 | module: {
27 | rules: [
28 | {
29 | test: /\.css$/,
30 | loader: [MiniCssExtractPlugin.loader, 'css-loader'],
31 | },
32 | ],
33 | },
34 | plugins: [
35 | autoWebPlugin,
36 | ],
37 | };
38 | ```
--------------------------------------------------------------------------------
/demo/load-local-file/dist-prod/README.md:
--------------------------------------------------------------------------------
1 | # 直接注入本地文件
2 |
3 | `WebPlugin`除了可以注入 webpack 生成的 chunk 外,还可以直接读取本地文件原封不动的注入到 HTML 里去。如下:
4 |
5 | ```html
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | ```
22 |
23 | 如果资源路径类似:
24 |
25 | * `./jquery.js` 以`./` `/` `../` 这些开头的就认为是要读取本地文件
26 | * `A` 这样的直接是一个单词,就认为是 webpack chunk
27 |
28 | 同时支持 JS 和 CSS
29 |
--------------------------------------------------------------------------------
/demo/auto-plugin-pagedir-object/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3 | const { AutoWebPlugin } = require('../../index');
4 |
5 | const autoWebPlugin = new AutoWebPlugin({
6 | home: 'src/home',
7 | login: 'src/login',
8 | }, {
9 | template: './src/template.html',
10 | outputPagemap: true,
11 | });
12 |
13 | module.exports = {
14 | output: {
15 | path: path.resolve(__dirname, 'dist'),
16 | filename: '[name].js',
17 | publicPath: 'https://cdn.cn/',
18 | },
19 | entry: autoWebPlugin.entry({
20 | }),
21 | module: {
22 | rules: [
23 | {
24 | test: /\.css$/,
25 | loader: [MiniCssExtractPlugin.loader, 'css-loader'],
26 | },
27 | ],
28 | },
29 | plugins: [
30 | new MiniCssExtractPlugin({
31 | filename: '[name].css',
32 | }),
33 | autoWebPlugin,
34 | ],
35 | };
36 |
--------------------------------------------------------------------------------
/demo/auto-plugin/dist/common.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["common"],{
2 |
3 | /***/ "./src/ignore/index.css":
4 | /*!******************************!*\
5 | !*** ./src/ignore/index.css ***!
6 | \******************************/
7 | /*! no static exports found */
8 | /***/ (function(module, exports, __webpack_require__) {
9 |
10 | eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack:///./src/ignore/index.css?");
11 |
12 | /***/ }),
13 |
14 | /***/ "./src/ignore/index.js":
15 | /*!*****************************!*\
16 | !*** ./src/ignore/index.js ***!
17 | \*****************************/
18 | /*! no static exports found */
19 | /***/ (function(module, exports) {
20 |
21 | eval("console.error('this dir should be ingore by AutoWebPlugin');\n\n\n//# sourceURL=webpack:///./src/ignore/index.js?");
22 |
23 | /***/ })
24 |
25 | }]);
--------------------------------------------------------------------------------
/demo/config-resource/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { WebPlugin } = require('../../index');
3 |
4 | module.exports = {
5 | output: {
6 | path: path.resolve(__dirname, 'dist-js'),
7 | filename: '[name].js',
8 | },
9 | entry: {
10 | 'ie-polyfill': './ie-polyfill',
11 | inline: './inline',
12 | dev: './dev',
13 | googleAnalytics: './google-analytics',
14 | },
15 | plugins: [
16 | new WebPlugin({
17 | filename: 'index.html',
18 | requires: {
19 | 'ie-polyfill': {
20 | _ie: true,
21 | crossorigin: 'anonymous',
22 | },
23 | inline: {
24 | _inline: true,
25 | _dist: true,
26 | },
27 | dev: {
28 | _dev: true,
29 | },
30 | //load a local google analyze file direct without local var webpack
31 | './google-analytics.js': {
32 | _dist: true,
33 | },
34 | },
35 | }),
36 | ],
37 | };
38 |
--------------------------------------------------------------------------------
/demo/out-html/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { WebPlugin } = require('../../index');
3 | const DefinePlugin = require('webpack/lib/DefinePlugin');
4 |
5 | module.exports = [
6 | {
7 | output: {
8 | path: path.resolve(__dirname, 'dist'),
9 | filename: '[name].js',
10 | },
11 | entry: {
12 | A: './a',
13 | },
14 | plugins: [
15 | new DefinePlugin({
16 | NAME: JSON.stringify('AA'),
17 | }),
18 | new WebPlugin({
19 | filename: 'a.html',
20 | requires: ['A', 'B'],
21 | }),
22 | ],
23 | },
24 | {
25 | output: {
26 | path: path.resolve(__dirname, 'dist'),
27 | filename: '[name].js',
28 | },
29 | entry: {
30 | B: './b',
31 | },
32 | plugins: [
33 | new DefinePlugin({
34 | NAME: JSON.stringify('BB'),
35 | }),
36 | new WebPlugin({
37 | filename: 'b.html',
38 | requires: ['A', 'B'],
39 | }),
40 | ],
41 | },
42 | ];
43 |
--------------------------------------------------------------------------------
/demo/relative-path/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3 | const { WebPlugin } = require('../../index');
4 |
5 | module.exports = {
6 | output: {
7 | path: path.resolve(__dirname, 'dist'),
8 | filename: 'js/[name].js',
9 | // publicPath: '//cdn.cn/'
10 | },
11 | entry: {
12 | A: './a',
13 | B: './b',
14 | },
15 | module: {
16 | rules: [
17 | {
18 | test: /\.css$/,
19 | loader: [MiniCssExtractPlugin.loader, 'css-loader'],
20 | },
21 | {
22 | test: /\.(pdf)$/,
23 | loader: 'file-loader',
24 | query: {
25 | name: 'img/[name]_[hash].[ext]',
26 | },
27 | },
28 | ],
29 | },
30 | plugins: [
31 | new MiniCssExtractPlugin({
32 | filename: '[name].css',
33 | }),
34 | new WebPlugin({
35 | filename: 'html/index.html',
36 | template: './template.html',
37 | }),
38 | ],
39 | };
40 |
--------------------------------------------------------------------------------
/demo/relative-path-public-path/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3 | const { WebPlugin } = require('../../index');
4 |
5 | module.exports = {
6 | output: {
7 | path: path.resolve(__dirname, 'dist'),
8 | filename: 'js/[name].js',
9 | publicPath: '//cdn.cn/',
10 | },
11 | entry: {
12 | A: './a',
13 | B: './b',
14 | },
15 | module: {
16 | rules: [
17 | {
18 | test: /\.css$/,
19 | loader: [MiniCssExtractPlugin.loader, 'css-loader'],
20 | },
21 | {
22 | test: /\.(pdf)$/,
23 | loader: 'file-loader',
24 | query: {
25 | name: 'img/[name]_[hash].[ext]',
26 | },
27 | },
28 | ],
29 | },
30 | plugins: [
31 | new MiniCssExtractPlugin({
32 | filename: '[name].css',
33 | }),
34 | new WebPlugin({
35 | filename: 'html/index.html',
36 | template: './template.html',
37 | }),
38 | ],
39 | };
40 |
--------------------------------------------------------------------------------
/demo/issue6/dist/polyfill.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t){alert("polyfill")}]);
--------------------------------------------------------------------------------
/demo/use-template/README.md:
--------------------------------------------------------------------------------
1 | # 使用 HTML 模版配置资源注入到 HTML
2 |
3 | 通过配置 webpack 的 entry,webpack 为我们生产了一系列 chunk。但是我们需要把这些 chunk 注入到 HTML 里才可以在浏览器里运行起来。
4 | `WebPlugin`可以方便的帮你把 chunk 注入到 HTML 里。
5 |
6 | ```js
7 | new WebPlugin({
8 | filename: 'index.html',
9 | template: './template.html',
10 | requires: ['A', 'B'],
11 | }),
12 | ```
13 |
14 | 使用 HTML 模版可以更细粒度的控制 chunk 的注入位置。同时你还可以控制每个 chunk 注入到 HTML 里的方式,通过`?_inline&_dev`这样 querystring 的方式来配置属性。
15 |
16 | 支持以下注入方式
17 |
18 | * `_dist` 只有在生产环境下才引入该资源
19 | * `_dev` 只有在开发环境下才引入该资源
20 | * `_inline` 把该资源的内容潜入到 html 里
21 | * `_ie` 只有 IE 浏览器才需要引入的资源,通过 `[if IE]>resource` 所在的位置,`` 不存在是注入到 BODY 标签的最后。
26 | * 剩余的所有 CSS 注入到 `` 所在的位置,`` 不存在是注入到 HEAD 标签的最后。
27 |
--------------------------------------------------------------------------------
/demo/out-html/dist/A.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t){alert("hello web-webpack-plugin fromAA")}]);
--------------------------------------------------------------------------------
/demo/out-html/dist/B.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t){alert("hello web-webpack-plugin fromBB")}]);
--------------------------------------------------------------------------------
/demo/pre-post-entrys/dist/polyfill.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t){console.log("polyfill")}]);
--------------------------------------------------------------------------------
/demo/config-resource/dist-js/googleAnalytics.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("GA")}]);
--------------------------------------------------------------------------------
/demo/out-pagemap/dist/A.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([,function(e,t){alert("hello web-webpack-plugin from a")}]);
--------------------------------------------------------------------------------
/demo/out-pagemap/dist/B.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t){alert("hello web-webpack-plugin from b")}]);
--------------------------------------------------------------------------------
/demo/config-resource/dist-js-prod/googleAnalytics.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("GA")}]);
--------------------------------------------------------------------------------
/demo/config-resource/dist-template/googleAnalytics.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("GA")}]);
--------------------------------------------------------------------------------
/demo/mutil-web-plugin/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const { WebPlugin } = require('../../index');
3 |
4 | const common = {
5 | output: {
6 | path: path.resolve(__dirname, 'dist'),
7 | filename: '[name].js',
8 | publicPath: 'https://cdn.cn/',
9 | },
10 | module: {
11 | rules: [
12 | {
13 | test: /\.css$/,
14 | loader: ['style-loader', 'css-loader'],
15 | },
16 | ],
17 | },
18 | };
19 |
20 | module.exports = [
21 | {
22 | ...common,
23 | entry: {
24 | home: './src/home',
25 | },
26 | plugins: [
27 | new WebPlugin({
28 | template: './src/template.html',
29 | outputPagemap: true,
30 | filename: 'home.html',
31 | }),
32 | ],
33 | },
34 | {
35 | ...common,
36 | entry: {
37 | login: './src/login',
38 | },
39 | plugins: [
40 | new WebPlugin({
41 | template: './src/template.html',
42 | outputPagemap: true,
43 | filename: 'login.html',
44 | }),
45 | ],
46 | },
47 | ];
48 |
--------------------------------------------------------------------------------
/demo/use-template/dist/A.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t){console.lo("hello web-webpack-plugin from a")}]);
--------------------------------------------------------------------------------
/demo/use-template/dist/B.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("hello web-webpack-plugin from b")}]);
--------------------------------------------------------------------------------
/demo/auto-plugin/dist-js-prod/polyfill.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="https://cdn.cn/",n(n.s=2)}({2:function(e,t){alert("polyfill")}});
--------------------------------------------------------------------------------
/demo/pre-post-entrys/dist/google-analytics.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("google-analytics")}]);
--------------------------------------------------------------------------------
/demo/auto-plugin/dist-js-prod/ie_polyfill.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="https://cdn.cn/",n(n.s=3)}({3:function(e,t){alert("ie_polyfill")}});
--------------------------------------------------------------------------------
/demo/config-html-attribute/dist/A.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t){console.lo("hello web-webpack-plugin from a")}]);
--------------------------------------------------------------------------------
/demo/config-html-attribute/dist/B.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("hello web-webpack-plugin from b")}]);
--------------------------------------------------------------------------------
/demo/config-resource/dist-js/dev.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([,function(e,t){alert("this script will only load in dev mode")}]);
--------------------------------------------------------------------------------
/demo/config-resource/dist-js/ie-polyfill.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}({3:function(e,t){alert("only IE will load this script")}});
--------------------------------------------------------------------------------
/demo/load-local-file/dist/A.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log("module A load from web-webpack-plugin")}]);
--------------------------------------------------------------------------------
/demo/config-resource/dist-js-prod/dev.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([,function(e,t){alert("this script will only load in dev mode")}]);
--------------------------------------------------------------------------------
/demo/config-resource/dist-js-prod/ie-polyfill.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}({3:function(e,t){alert("only IE will load this script")}});
--------------------------------------------------------------------------------
/demo/config-resource/dist-js/inline.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}({2:function(e,t){alert("this script will be inject into html inline")}});
--------------------------------------------------------------------------------
/demo/config-resource/dist-template/dev.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([,function(e,t){alert("this script will only load in dev mode")}]);
--------------------------------------------------------------------------------
/demo/config-resource/dist-template/ie-polyfill.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}({3:function(e,t){alert("only IE will load this script")}});
--------------------------------------------------------------------------------
/demo/minify-html/dist/A.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){!function(e){console.log(e)}("hello web-webpack-plugin from a")}]);
--------------------------------------------------------------------------------
/demo/auto-plugin-logic-filename/dist/home.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}({4:function(e,t){alert("page home")},5:function(e,t,r){e.exports=r(4)}});
--------------------------------------------------------------------------------
/demo/auto-plugin-logic-filename/dist/login.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([,,function(e,t){alert("page login")},function(e,t,n){e.exports=n(2)}]);
--------------------------------------------------------------------------------
/demo/auto-plugin-logic-filename/dist/signup.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){alert("page signup")},function(e,t,n){e.exports=n(0)}]);
--------------------------------------------------------------------------------
/demo/config-resource/dist-js-prod/inline.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}({2:function(e,t){alert("this script will be inject into html inline")}});
--------------------------------------------------------------------------------
/demo/config-resource/dist-template/inline.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}({2:function(e,t){alert("this script will be inject into html inline")}});
--------------------------------------------------------------------------------
/demo/relative-path/dist/js/B.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([,function(e,t,n){},function(e,t,n){console.log("hello web-webpack-plugin from b"),n(1)}]);
--------------------------------------------------------------------------------
/demo/issue6/dist/login.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}({6:function(e,t,n){},7:function(e,t,n){n(6),alert("page login")},8:function(e,t,n){e.exports=n(7)}});
--------------------------------------------------------------------------------
/demo/issue6/dist/signup.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([,,function(e,t,n){},function(e,t,n){n(2),alert("page signup")},function(e,t,n){e.exports=n(3)}]);
--------------------------------------------------------------------------------
/demo/public-path/dist/A.js:
--------------------------------------------------------------------------------
1 | !function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="//js.cdn",t(t.s=5)}({4:function(e,n,t){},5:function(e,n,t){console.lo("hello web-webpack-plugin from a"),t(4)}});
--------------------------------------------------------------------------------
/demo/public-path/dist/B.js:
--------------------------------------------------------------------------------
1 | !function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="//js.cdn",t(t.s=2)}([,function(e,n,t){},function(e,n,t){console.log("hello web-webpack-plugin from b"),t(1)}]);
--------------------------------------------------------------------------------
/demo/issue6/dist/home.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=12)}({10:function(e,t,n){},11:function(e,t,n){n(10),alert("page home")},12:function(e,t,n){e.exports=n(11)}});
--------------------------------------------------------------------------------
/demo/use-template-complier/dist/a.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([,,function(e,t){console.lo("hello web-webpack-plugin from a")},function(e,t,n){e.exports=n(2)}]);
--------------------------------------------------------------------------------
/demo/use-template-complier/dist/b.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){console.log("hello web-webpack-plugin from b")},function(e,t,n){e.exports=n(0)}]);
--------------------------------------------------------------------------------
/demo/load-local-file/dist-prod/A_ae7690b3d3399e308cf1.js:
--------------------------------------------------------------------------------
1 | !function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="//cdn.cn/web",t(t.s=0)}([function(e,n){console.log("module A load from web-webpack-plugin")}]);
--------------------------------------------------------------------------------
/demo/relative-path-public-path/dist/js/B.js:
--------------------------------------------------------------------------------
1 | !function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="//cdn.cn/",t(t.s=2)}([,function(e,n,t){},function(e,n,t){console.log("hello web-webpack-plugin from b"),t(1)}]);
--------------------------------------------------------------------------------
/demo/issue6/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const fs = require('fs');
3 | const ejs = require('ejs');
4 | const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5 | const { AutoWebPlugin } = require('../../index');
6 |
7 | const autoPlugin = new AutoWebPlugin('./src/', {
8 | template: './src/template.ejs',
9 | templateCompiler: (pageName, templateFullPath) => {
10 | const ejsTemplate = fs.readFileSync(templateFullPath, {
11 | encoding: 'utf8',
12 | });
13 | return ejs.render(ejsTemplate, {
14 | pageName,
15 | });
16 | },
17 | });
18 |
19 | module.exports = {
20 | output: {
21 | path: path.resolve(__dirname, 'dist'),
22 | filename: '[name].js',
23 | },
24 | entry: autoPlugin.entry({
25 | polyfill: './src/polyfill',
26 | }),
27 | module: {
28 | rules: [
29 | {
30 | test: /\.css$/,
31 | loader: [MiniCssExtractPlugin.loader, 'css-loader'],
32 | },
33 | ],
34 | },
35 | plugins: [
36 | new MiniCssExtractPlugin({
37 | filename: '[name].css',
38 | }),
39 | autoPlugin,
40 | ],
41 | };
42 |
--------------------------------------------------------------------------------
/demo/pre-post-entrys/dist/page1.js:
--------------------------------------------------------------------------------
1 | !function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(o,r,function(n){return e[n]}.bind(null,r));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=3)}([function(e,n){console.log("google-analytics")},function(e,n){console.log("polyfill")},function(e,n){console.log("page1")},function(e,n,t){t(1),t(2),e.exports=t(0)}]);
--------------------------------------------------------------------------------
/demo/relative-path/dist/js/A.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([,,,function(e,t,n){e.exports=n.p+"img/resume_c527df321483df995119f1cfa5ccbcf8.pdf"},,function(e,t,n){},function(e,t,n){console.lo("hello web-webpack-plugin from a"),n(5),n(3)}]);
--------------------------------------------------------------------------------
/demo/relative-path-public-path/dist/js/A.js:
--------------------------------------------------------------------------------
1 | !function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="//cdn.cn/",t(t.s=6)}([,,,function(e,n,t){e.exports=t.p+"img/resume_c527df321483df995119f1cfa5ccbcf8.pdf"},,function(e,n,t){},function(e,n,t){console.lo("hello web-webpack-plugin from a"),t(5),t(3)}]);
--------------------------------------------------------------------------------
/demo/config-resource/README.md:
--------------------------------------------------------------------------------
1 | # 在 webpack 里直接通过 JS 配置资源注入到 HTML
2 |
3 | 通过配置 webpack 的 entry,webpack 为我们生产了一系列 chunk。但是我们需要把这些 chunk 注入到 HTML 里才可以在浏览器里运行起来。
4 | `WebPlugin`可以方便的帮你把 chunk 注入到 HTML 里。
5 |
6 | ```js
7 | new WebPlugin({
8 | filename: 'index.html',
9 | requires: {
10 | 'ie-polyfill': {
11 | _ie: true,
12 | },
13 | inline: {
14 | _inline: true,
15 | _dist: true,
16 | },
17 | dev: {
18 | _dev: true,
19 | },
20 | //load a local google analyze file direct without local var webpack
21 | './google-analytics.js': {
22 | _dist: true,
23 | },
24 | },
25 | });
26 | ```
27 |
28 | 通过`requires`属性可以配置 chunk 注入到 HTML 里的方式。`requires`的值可以是一个数组或是一个 object。
29 |
30 | * 为数组时,数组里的每一项都是 chunk 的名称。
31 | * 为 object 时,可以配置每个 chunk 的注入方式
32 |
33 | 支持以下注入方式
34 |
35 | * `_dist` 只有在生产环境下才引入该资源
36 | * `_dev` 只有在开发环境下才引入该资源
37 | * `_inline` 把该资源的内容潜入到 html 里
38 | * `_ie` 只有 IE 浏览器才需要引入的资源,通过 `[if IE]>resource
--------------------------------------------------------------------------------
/demo/minify-html/dist/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/demo/auto-plugin-react-typescript/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3 | const { AutoWebPlugin } = require('../../index');
4 |
5 | const autoWebPlugin = new AutoWebPlugin('./src/pages', {
6 | template: './src/template.html',
7 | });
8 |
9 | module.exports = {
10 | mode: 'development',
11 | output: {
12 | path: path.resolve(__dirname, 'dist'),
13 | filename: '[name].[chunkhash].js',
14 | },
15 | entry: autoWebPlugin.entry({
16 | base: './src/base.ts',
17 | }),
18 | optimization: {
19 | runtimeChunk: {
20 | name: 'runtime',
21 | },
22 | splitChunks: {
23 | minSize: 0,
24 | cacheGroups: {
25 | base: {
26 | chunks: 'all',
27 | name: 'base',
28 | test: 'base',
29 | },
30 | common: {
31 | chunks: 'all',
32 | name: 'common',
33 | minChunks: 2,
34 | },
35 | },
36 | },
37 | },
38 | resolve: {
39 | // 先尝试 ts,tsx 后缀的 TypeScript 源码文件
40 | extensions: ['.ts', '.tsx', '.js'],
41 | },
42 | module: {
43 | rules: [
44 | {
45 | test: /\.css$/,
46 | loader: [MiniCssExtractPlugin.loader, 'css-loader'],
47 | },
48 | {
49 | test: /\.tsx?$/,
50 | loader: ['ts-loader'],
51 | },
52 | ],
53 | },
54 | plugins: [
55 | new MiniCssExtractPlugin({
56 | filename: '[contenthash].css',
57 | }),
58 | autoWebPlugin,
59 | ],
60 | };
61 |
--------------------------------------------------------------------------------
/demo/auto-plugin-react-typescript/README.md:
--------------------------------------------------------------------------------
1 | # 提取基础运行库
2 |
3 | ```js
4 | const path = require('path');
5 | const MiniCssExtractPlugin = require('mini-css-extract-plugin');
6 | const { AutoWebPlugin } = require('../../index');
7 |
8 | const autoWebPlugin = new AutoWebPlugin('./src/pages', {
9 | template: './src/template.html',
10 | });
11 |
12 | module.exports = {
13 | mode: 'development',
14 | output: {
15 | path: path.resolve(__dirname, 'dist'),
16 | filename: '[name].[chunkhash].js',
17 | },
18 | entry: autoWebPlugin.entry({
19 | base: './src/base.ts',
20 | }),
21 | optimization: {
22 | runtimeChunk: {
23 | name: 'runtime',
24 | },
25 | splitChunks: {
26 | minSize: 0,
27 | cacheGroups: {
28 | base: {
29 | chunks: 'all',
30 | name: 'base',
31 | test: 'base',
32 | },
33 | common: {
34 | chunks: 'all',
35 | name: 'common',
36 | minChunks: 2,
37 | },
38 | },
39 | },
40 | },
41 | resolve: {
42 | // 先尝试 ts,tsx 后缀的 TypeScript 源码文件
43 | extensions: ['.ts', '.tsx', '.js'],
44 | },
45 | module: {
46 | rules: [
47 | {
48 | test: /\.css$/,
49 | loader: [MiniCssExtractPlugin.loader, 'css-loader'],
50 | },
51 | {
52 | test: /\.tsx?$/,
53 | loader: ['ts-loader'],
54 | },
55 | ],
56 | },
57 | plugins: [
58 | new MiniCssExtractPlugin({
59 | filename: '[contenthash].css',
60 | }),
61 | autoWebPlugin,
62 | ],
63 | };
64 | ```
65 |
--------------------------------------------------------------------------------
/demo/config-resource/dist-template/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/demo/issue6/dist/home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/demo/issue6/dist/login.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/demo/issue6/dist/signup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/demo/auto-plugin/dist-js-prod/home.js:
--------------------------------------------------------------------------------
1 | !function(e){function n(n){for(var r,f,i=n[0],l=n[1],c=n[2],a=0,s=[];a