├── 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
Button Component
; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /demo/public-path/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/use-template-complier/template.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <%= title %> 7 | 8 | 9 | 10 | <% include footer.ejs %> 11 | 12 | -------------------------------------------------------------------------------- /demo/mutil-web-plugin/src/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/minify-html/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /demo/mutil-web-plugin/dist/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/mutil-web-plugin/dist/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/auto-plugin-pagedir-object/src/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/auto-plugin-logic-filename/README.md: -------------------------------------------------------------------------------- 1 | # AutoWebPlugin 可以自定义输出的 html 文件名称 2 | 3 | `AutoWebPlugin` 可以自定义输出的 html 文件名称的逻辑,只需给 filename 传一个 function 即可。这个函数定义为:`(pageName)=> newPageName`, 4 | 5 | 加入配置如下,有一个 page 的目录名称为`login`,则`pageName='login'`,实际输出的 html 文件名称为`login++.html`。 6 | 7 | ```js 8 | new AutoWebPlugin('./src/', { 9 | filename: (pageName) => `${pageName}++`, 10 | }); 11 | ``` 12 | -------------------------------------------------------------------------------- /demo/auto-plugin/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"},"signup":{"publicPath":"https://cdn.cn/","js":["signup.js"],"css":["signup.css"],"asyncJs":[],"asyncCss":[],"html":"signup.html"}} -------------------------------------------------------------------------------- /demo/public-path/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /demo/auto-plugin/dist-js-prod/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"},"signup":{"publicPath":"https://cdn.cn/","js":["signup.js"],"css":["signup.css"],"asyncJs":[],"asyncCss":[],"html":"signup.html"}} -------------------------------------------------------------------------------- /demo/extract-css/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /demo/use-template-complier/dist/a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | a 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /demo/use-template-complier/dist/b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | b 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /demo/load-local-file/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 | }, 12 | plugins: [ 13 | new WebPlugin({ 14 | filename: 'index.html', 15 | template: './template.html', 16 | }), 17 | ], 18 | }; 19 | -------------------------------------------------------------------------------- /demo/auto-plugin-logic-filename/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const { AutoWebPlugin } = require('../../index'); 3 | 4 | const autoPlugin = new AutoWebPlugin('./src/', { 5 | filename: (pageName) => `${pageName}++`, 6 | }); 7 | 8 | module.exports = { 9 | entry: autoPlugin.entry(), 10 | output: { 11 | path: path.resolve(__dirname, 'dist'), 12 | filename: '[name].js', 13 | }, 14 | plugins: [autoPlugin], 15 | }; 16 | -------------------------------------------------------------------------------- /demo/config-resource/dist-js/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /demo/issue6/src/template.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/config-resource/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /demo/use-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/relative-path/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | math 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 |
11 | PageHome 12 |
14 | ); 15 | } 16 | } 17 | 18 | render(, document.getElementById('app')); 19 | -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/src/pages/login/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 |
11 | PageHome 12 |
14 | ); 15 | } 16 | } 17 | 18 | render(, document.getElementById('app')); 19 | -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/src/pages/signup/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 |
11 | PageHome 12 |
14 | ); 15 | } 16 | } 17 | 18 | render(, document.getElementById('app')); 19 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
web-webpack-plugin
12 | 13 | math 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 |
web-webpack-plugin
13 | 14 | math 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 |
web-webpack-plugin
15 | 16 | -------------------------------------------------------------------------------- /demo/relative-path-public-path/dist/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
web-webpack-plugin
13 | 14 | math 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 |
footer
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /demo/use-template/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
web-webpack-plugin
15 | 16 | -------------------------------------------------------------------------------- /demo/watch-template/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 |
web-webpack-plugin
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 |
web-webpack-plugin
15 | 16 | -------------------------------------------------------------------------------- /demo/use-template/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 |
web-webpack-plugin
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 |
web-webpack-plugin
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 |
web-webpack-plugin
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 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
footer
61 | 62 | 63 | ``` 64 | -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/dist/common.265b1c1247739909f9f3.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["common"],{ 2 | 3 | /***/ "./src/components/Button/index.css": 4 | /*!*****************************************!*\ 5 | !*** ./src/components/Button/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/components/Button/index.css?"); 11 | 12 | /***/ }), 13 | 14 | /***/ "./src/components/Button/index.tsx": 15 | /*!*****************************************!*\ 16 | !*** ./src/components/Button/index.tsx ***! 17 | \*****************************************/ 18 | /*! no static exports found */ 19 | /***/ (function(module, exports, __webpack_require__) { 20 | 21 | "use strict"; 22 | eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.js\");\nvar react_1 = __webpack_require__(/*! react */ \"../../node_modules/react/index.js\");\nvar React = __webpack_require__(/*! react */ \"../../node_modules/react/index.js\");\n__webpack_require__(/*! ./index.css */ \"./src/components/Button/index.css\");\nvar Button = /** @class */ (function (_super) {\n tslib_1.__extends(Button, _super);\n function Button() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Button.prototype.render = function () {\n return React.createElement(\"div\", { className: \"button-component\" }, \"Button Component\");\n };\n return Button;\n}(react_1.Component));\nexports.Button = Button;\n\n\n//# sourceURL=webpack:///./src/components/Button/index.tsx?"); 23 | 24 | /***/ }) 25 | 26 | }]); -------------------------------------------------------------------------------- /demo/auto-plugin/README.md: -------------------------------------------------------------------------------- 1 | # 管理多个单页应用 2 | 3 | `AutoWebPlugin` 可以自动管理多个单页应用。简单使用如下 4 | 5 | ```js 6 | const path = require('path'); 7 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); 8 | const { AutoWebPlugin } = require('../../index'); 9 | 10 | const autoWebPlugin = new AutoWebPlugin('./src/', { 11 | ignorePages: ['ignore'], 12 | template: './src/template.html', 13 | outputPagemap: true, 14 | }); 15 | 16 | module.exports = { 17 | output: { 18 | path: path.resolve(__dirname, 'dist'), 19 | filename: '[name].js', 20 | publicPath: 'https://cdn.cn/', 21 | }, 22 | entry: autoWebPlugin.entry({ 23 | ie_polyfill: './src/ie_polyfill', 24 | polyfill: './src/polyfill', 25 | }), 26 | optimization: { 27 | splitChunks: { 28 | minSize: 0, 29 | cacheGroups: { 30 | commons: { 31 | chunks: 'initial', 32 | name: 'common', 33 | minChunks: 2, 34 | }, 35 | }, 36 | }, 37 | }, 38 | module: { 39 | rules: [ 40 | { 41 | test: /\.css$/, 42 | loader: [MiniCssExtractPlugin.loader, 'css-loader'], 43 | }, 44 | ], 45 | }, 46 | plugins: [ 47 | new MiniCssExtractPlugin({ 48 | filename: '[name].css', 49 | }), 50 | autoWebPlugin, 51 | ], 52 | }; 53 | ``` 54 | 55 | 以上配置会让`AutoWebPlugin`找出`./src/`目录下的所有目录,为每个目录生产一个 HTML 作为单页应用的入口。 56 | 57 | * `ignorePages` 属性用了忽略名叫`ignore`的目录,不为这个目录生产 HTML 入口 58 | * `template` 属性指出所有单页应用生产 HTML 入口时公用的 HTML 模版,模版语法和`WebPlugin`里一致。 59 | * `outputPagemap` 属性用来输出一个叫`pagemap.json`的文件,里面存放了`AutoWebPlugin`找出的所有单页应用的名称和 URL 的映射关系。 60 | 61 | `AutoWebPlugin`还支持很多配置选项,你可以[在这里看到](https://github.com/gwuhaolin/web-webpack-plugin/blob/master/lib/AutoWebPlugin.js#L33)。 62 | 63 | 更多关于`AutoWebPlugin`的资料可以参考以下文章: 64 | 65 | * [webpack 原理与实战](https://github.com/gwuhaolin/blog/issues/4) 66 | * [webpack2 终极优化](https://github.com/gwuhaolin/blog/issues/2) 67 | -------------------------------------------------------------------------------- /demo/config-html-attribute/README.md: -------------------------------------------------------------------------------- 1 | # 给 HTML 标签注入属性 2 | 3 | 有时你需要为 HTML 标签设置一些属性,例如你想为 Webpack 生成的 Chunk B 对应的 `script` 标签带上 `crossorigin=anonymous` 属性,你可以通过在 querystring 中带上非 **\_** 开头的属性名称和对应的值即可。 4 | 5 | HTML 模版如下: 6 | 7 | ```html 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
web-webpack-plugin
22 | 23 | 24 | ``` 25 | 26 | 输出的 HTML: 27 | 28 | ```html 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | ``` 49 | 50 | 同时你会发现除了 querystring 中非 **\_** 开头的属性被注入到了输出的 HTML 标签中外,原模版里的自带的属性被会保留原样,如上面的 `charset="x-UTF-16LE-BOM"`。 51 | 52 | 除此之外,采用在配置文件里配置属性的方式也可以给 HTML 标签注入属性: 53 | 54 | ```js 55 | new WebPlugin({ 56 | filename: 'index.html', 57 | requires: { 58 | 'ie-polyfill': { 59 | _ie: true, 60 | crossorigin: 'anonymous', 61 | }, 62 | }, 63 | }); 64 | ``` 65 | -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/dist/home.87d641acdc6b2f120dce.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["home"],{ 2 | 3 | /***/ "./src/pages/home/index.css": 4 | /*!**********************************!*\ 5 | !*** ./src/pages/home/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/pages/home/index.css?"); 11 | 12 | /***/ }), 13 | 14 | /***/ "./src/pages/home/index.tsx": 15 | /*!**********************************!*\ 16 | !*** ./src/pages/home/index.tsx ***! 17 | \**********************************/ 18 | /*! no static exports found */ 19 | /***/ (function(module, exports, __webpack_require__) { 20 | 21 | "use strict"; 22 | eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.js\");\nvar react_1 = __webpack_require__(/*! react */ \"../../node_modules/react/index.js\");\nvar React = __webpack_require__(/*! react */ \"../../node_modules/react/index.js\");\nvar react_dom_1 = __webpack_require__(/*! react-dom */ \"../../node_modules/react-dom/index.js\");\nvar Button_1 = __webpack_require__(/*! ../../components/Button */ \"./src/components/Button/index.tsx\");\n__webpack_require__(/*! ./index.css */ \"./src/pages/home/index.css\");\nvar PageHome = /** @class */ (function (_super) {\n tslib_1.__extends(PageHome, _super);\n function PageHome() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PageHome.prototype.render = function () {\n return (React.createElement(\"div\", null,\n \"PageHome\",\n React.createElement(Button_1.Button, null)));\n };\n return PageHome;\n}(react_1.Component));\nreact_dom_1.render(React.createElement(PageHome, null), document.getElementById('app'));\n\n\n//# sourceURL=webpack:///./src/pages/home/index.tsx?"); 23 | 24 | /***/ }), 25 | 26 | /***/ 0: 27 | /*!******************************!*\ 28 | !*** multi ./src/pages/home ***! 29 | \******************************/ 30 | /*! no static exports found */ 31 | /***/ (function(module, exports, __webpack_require__) { 32 | 33 | eval("module.exports = __webpack_require__(/*! /Users/halwu/WebstormProjects/web-webpack-plugin/demo/auto-plugin-react-typescript/src/pages/home */\"./src/pages/home/index.tsx\");\n\n\n//# sourceURL=webpack:///multi_./src/pages/home?"); 34 | 35 | /***/ }) 36 | 37 | },[[0,"runtime","common","base"]]]); -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/dist/login.4293fb994102c1c5ef89.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["login"],{ 2 | 3 | /***/ "./src/pages/login/index.css": 4 | /*!***********************************!*\ 5 | !*** ./src/pages/login/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/pages/login/index.css?"); 11 | 12 | /***/ }), 13 | 14 | /***/ "./src/pages/login/index.tsx": 15 | /*!***********************************!*\ 16 | !*** ./src/pages/login/index.tsx ***! 17 | \***********************************/ 18 | /*! no static exports found */ 19 | /***/ (function(module, exports, __webpack_require__) { 20 | 21 | "use strict"; 22 | eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.js\");\nvar react_1 = __webpack_require__(/*! react */ \"../../node_modules/react/index.js\");\nvar React = __webpack_require__(/*! react */ \"../../node_modules/react/index.js\");\nvar react_dom_1 = __webpack_require__(/*! react-dom */ \"../../node_modules/react-dom/index.js\");\nvar Button_1 = __webpack_require__(/*! ../../components/Button */ \"./src/components/Button/index.tsx\");\n__webpack_require__(/*! ./index.css */ \"./src/pages/login/index.css\");\nvar PageHome = /** @class */ (function (_super) {\n tslib_1.__extends(PageHome, _super);\n function PageHome() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PageHome.prototype.render = function () {\n return (React.createElement(\"div\", null,\n \"PageHome\",\n React.createElement(Button_1.Button, null)));\n };\n return PageHome;\n}(react_1.Component));\nreact_dom_1.render(React.createElement(PageHome, null), document.getElementById('app'));\n\n\n//# sourceURL=webpack:///./src/pages/login/index.tsx?"); 23 | 24 | /***/ }), 25 | 26 | /***/ 3: 27 | /*!*******************************!*\ 28 | !*** multi ./src/pages/login ***! 29 | \*******************************/ 30 | /*! no static exports found */ 31 | /***/ (function(module, exports, __webpack_require__) { 32 | 33 | eval("module.exports = __webpack_require__(/*! /Users/halwu/WebstormProjects/web-webpack-plugin/demo/auto-plugin-react-typescript/src/pages/login */\"./src/pages/login/index.tsx\");\n\n\n//# sourceURL=webpack:///multi_./src/pages/login?"); 34 | 35 | /***/ }) 36 | 37 | },[[3,"runtime","common","base"]]]); -------------------------------------------------------------------------------- /demo/auto-plugin-react-typescript/dist/signup.1845e32ed5ae26cd164c.js: -------------------------------------------------------------------------------- 1 | (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["signup"],{ 2 | 3 | /***/ "./src/pages/signup/index.css": 4 | /*!************************************!*\ 5 | !*** ./src/pages/signup/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/pages/signup/index.css?"); 11 | 12 | /***/ }), 13 | 14 | /***/ "./src/pages/signup/index.tsx": 15 | /*!************************************!*\ 16 | !*** ./src/pages/signup/index.tsx ***! 17 | \************************************/ 18 | /*! no static exports found */ 19 | /***/ (function(module, exports, __webpack_require__) { 20 | 21 | "use strict"; 22 | eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = __webpack_require__(/*! tslib */ \"../../node_modules/tslib/tslib.es6.js\");\nvar react_1 = __webpack_require__(/*! react */ \"../../node_modules/react/index.js\");\nvar React = __webpack_require__(/*! react */ \"../../node_modules/react/index.js\");\nvar react_dom_1 = __webpack_require__(/*! react-dom */ \"../../node_modules/react-dom/index.js\");\nvar Button_1 = __webpack_require__(/*! ../../components/Button */ \"./src/components/Button/index.tsx\");\n__webpack_require__(/*! ./index.css */ \"./src/pages/signup/index.css\");\nvar PageHome = /** @class */ (function (_super) {\n tslib_1.__extends(PageHome, _super);\n function PageHome() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PageHome.prototype.render = function () {\n return (React.createElement(\"div\", null,\n \"PageHome\",\n React.createElement(Button_1.Button, null)));\n };\n return PageHome;\n}(react_1.Component));\nreact_dom_1.render(React.createElement(PageHome, null), document.getElementById('app'));\n\n\n//# sourceURL=webpack:///./src/pages/signup/index.tsx?"); 23 | 24 | /***/ }), 25 | 26 | /***/ 5: 27 | /*!********************************!*\ 28 | !*** multi ./src/pages/signup ***! 29 | \********************************/ 30 | /*! no static exports found */ 31 | /***/ (function(module, exports, __webpack_require__) { 32 | 33 | eval("module.exports = __webpack_require__(/*! /Users/halwu/WebstormProjects/web-webpack-plugin/demo/auto-plugin-react-typescript/src/pages/signup */\"./src/pages/signup/index.tsx\");\n\n\n//# sourceURL=webpack:///multi_./src/pages/signup?"); 34 | 35 | /***/ }) 36 | 37 | },[[5,"runtime","common","base"]]]); -------------------------------------------------------------------------------- /demo/watch-template/dist/A.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { 2 | // webpackBootstrap 3 | /******/ // The module cache 4 | /******/ var installedModules = {}; // The require function 5 | /******/ 6 | /******/ /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if (installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ 12 | } // Create a new module (and put it into the cache) 13 | /******/ /******/ var module = (installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {}, 17 | /******/ 18 | }); // Execute the module function 19 | /******/ 20 | /******/ /******/ modules[moduleId].call( 21 | module.exports, 22 | module, 23 | module.exports, 24 | __webpack_require__ 25 | ); // Flag the module as loaded 26 | /******/ 27 | /******/ /******/ module.l = true; // Return the exports of the module 28 | /******/ 29 | /******/ /******/ return module.exports; 30 | /******/ 31 | } // expose the modules object (__webpack_modules__) 32 | /******/ 33 | /******/ 34 | /******/ /******/ __webpack_require__.m = modules; // expose the module cache 35 | /******/ 36 | /******/ /******/ __webpack_require__.c = installedModules; // define getter function for harmony exports 37 | /******/ 38 | /******/ /******/ __webpack_require__.d = function(exports, name, getter) { 39 | /******/ if (!__webpack_require__.o(exports, name)) { 40 | /******/ Object.defineProperty(exports, name, { 41 | /******/ configurable: false, 42 | /******/ enumerable: true, 43 | /******/ get: getter, 44 | /******/ 45 | }); 46 | /******/ 47 | } 48 | /******/ 49 | }; // getDefaultExport function for compatibility with non-harmony modules 50 | /******/ 51 | /******/ /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = 53 | module && module.__esModule 54 | ? /******/ function getDefault() { 55 | return module['default']; 56 | } 57 | : /******/ function getModuleExports() { 58 | return module; 59 | }; 60 | /******/ __webpack_require__.d(getter, 'a', getter); 61 | /******/ return getter; 62 | /******/ 63 | }; // Object.prototype.hasOwnProperty.call 64 | /******/ 65 | /******/ /******/ __webpack_require__.o = function(object, property) { 66 | return Object.prototype.hasOwnProperty.call(object, property); 67 | }; // __webpack_public_path__ 68 | /******/ 69 | /******/ /******/ __webpack_require__.p = ''; // Load entry module and return exports 70 | /******/ 71 | /******/ /******/ return __webpack_require__((__webpack_require__.s = 0)); 72 | /******/ 73 | })( 74 | /************************************************************************/ 75 | /******/ [ 76 | /* 0 */ 77 | /***/ function(module, exports) { 78 | console.lo('hello web-webpack-plugin from a'); 79 | 80 | /***/ 81 | }, 82 | /******/ 83 | ] 84 | ); 85 | -------------------------------------------------------------------------------- /demo/watch-template/dist/B.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { 2 | // webpackBootstrap 3 | /******/ // The module cache 4 | /******/ var installedModules = {}; // The require function 5 | /******/ 6 | /******/ /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if (installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ 12 | } // Create a new module (and put it into the cache) 13 | /******/ /******/ var module = (installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {}, 17 | /******/ 18 | }); // Execute the module function 19 | /******/ 20 | /******/ /******/ modules[moduleId].call( 21 | module.exports, 22 | module, 23 | module.exports, 24 | __webpack_require__ 25 | ); // Flag the module as loaded 26 | /******/ 27 | /******/ /******/ module.l = true; // Return the exports of the module 28 | /******/ 29 | /******/ /******/ return module.exports; 30 | /******/ 31 | } // expose the modules object (__webpack_modules__) 32 | /******/ 33 | /******/ 34 | /******/ /******/ __webpack_require__.m = modules; // expose the module cache 35 | /******/ 36 | /******/ /******/ __webpack_require__.c = installedModules; // define getter function for harmony exports 37 | /******/ 38 | /******/ /******/ __webpack_require__.d = function(exports, name, getter) { 39 | /******/ if (!__webpack_require__.o(exports, name)) { 40 | /******/ Object.defineProperty(exports, name, { 41 | /******/ configurable: false, 42 | /******/ enumerable: true, 43 | /******/ get: getter, 44 | /******/ 45 | }); 46 | /******/ 47 | } 48 | /******/ 49 | }; // getDefaultExport function for compatibility with non-harmony modules 50 | /******/ 51 | /******/ /******/ __webpack_require__.n = function(module) { 52 | /******/ var getter = 53 | module && module.__esModule 54 | ? /******/ function getDefault() { 55 | return module['default']; 56 | } 57 | : /******/ function getModuleExports() { 58 | return module; 59 | }; 60 | /******/ __webpack_require__.d(getter, 'a', getter); 61 | /******/ return getter; 62 | /******/ 63 | }; // Object.prototype.hasOwnProperty.call 64 | /******/ 65 | /******/ /******/ __webpack_require__.o = function(object, property) { 66 | return Object.prototype.hasOwnProperty.call(object, property); 67 | }; // __webpack_public_path__ 68 | /******/ 69 | /******/ /******/ __webpack_require__.p = ''; // Load entry module and return exports 70 | /******/ 71 | /******/ /******/ return __webpack_require__((__webpack_require__.s = 1)); 72 | /******/ 73 | })( 74 | /************************************************************************/ 75 | /******/ [ 76 | , 77 | /* 0 */ /* 1 */ 78 | /***/ function(module, exports) { 79 | console.log('hello web-webpack-plugin from b'); 80 | 81 | /***/ 82 | }, 83 | /******/ 84 | ] 85 | ); 86 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web-webpack-plugin", 3 | "version": "5.0.0", 4 | "description": "web plugin for webpack, alternatives for html-webpack-plugin, use HTML as entry", 5 | "keywords": [ 6 | "webpack", 7 | "webpack4", 8 | "plugin", 9 | "html", 10 | "web", 11 | "entry" 12 | ], 13 | "repository": { 14 | "type": "git", 15 | "url": "git@github.com:gwuhaolin/web-webpack-plugin.git" 16 | }, 17 | "main": "index.js", 18 | "author": "gwuhaolin", 19 | "engines": { 20 | "node": ">=6.11.5" 21 | }, 22 | "scripts": { 23 | "precommit": "eslint lib", 24 | "eslint:fix": "eslint lib --fix", 25 | "demo:auto-plugin": "cd demo/auto-plugin && rm -rf dist && rm -rf dist-js-prod && webpack --mode development && webpack --mode production --output-path dist-js-prod && cd ../../", 26 | "demo:auto-plugin-pagedir-object": "cd demo/auto-plugin-pagedir-object && rm -rf dist && webpack --mode development && cd ../../", 27 | "demo:mutil-web-plugin": "cd demo/mutil-web-plugin && rm -rf dist && webpack --mode development && cd ../../", 28 | "demo:auto-plugin-logic-filename": "cd demo/auto-plugin-logic-filename && rm -rf dist && webpack && cd ../../", 29 | "demo:auto-plugin-react-typescript": "cd demo/auto-plugin-react-typescript && rm -rf dist && webpack && cd ../../", 30 | "demo:config-resource": "cd demo/config-resource && rm -rf dist-js && rm -rf dist-js-prod && rm -rf dist-template && rm -rf dist && webpack && webpack --config webpack.config-template.js && webpack -p --output-path dist-js-prod && cd ../../", 31 | "demo:out-html": "cd demo/out-html && rm -rf dist && webpack && cd ../../", 32 | "demo:out-pagemap": "cd demo/out-pagemap && rm -rf dist && webpack && cd ../../", 33 | "demo:issue6": "cd demo/issue6 && rm -rf dist && webpack && cd ../../", 34 | "demo:use-template": "cd demo/use-template && rm -rf dist && webpack && cd ../../", 35 | "demo:config-html-attribute": "cd demo/config-html-attribute && rm -rf dist && webpack && cd ../../", 36 | "demo:minify-html": "cd demo/minify-html && rm -rf dist && webpack && cd ../../", 37 | "demo:use-template-complier": "cd demo/use-template-complier && rm -rf dist && webpack && cd ../../", 38 | "demo:watch-template-complier": "cd demo/use-template-complier && rm -rf dist && webpack -w && cd ../../", 39 | "demo:watch-template": "cd demo/watch-template && rm -rf dist && webpack -w && cd ../../", 40 | "demo:extract-css": "cd demo/extract-css && rm -rf dist && webpack && cd ../../", 41 | "demo:public-path": "cd demo/public-path && rm -rf dist && webpack && cd ../../", 42 | "demo:relative-path": "cd demo/relative-path && rm -rf dist && webpack && cd ../../", 43 | "demo:relative-path-public-path": "cd demo/relative-path-public-path && rm -rf dist && webpack && cd ../../", 44 | "demo:pre-post-entrys": "cd demo/pre-post-entrys && rm -rf dist && webpack && cd ../../", 45 | "demo:hmr": "cd demo/hmr && webpack-dev-server --hot", 46 | "demo:load-local-file": "cd demo/load-local-file && rm -rf dist && rm -rf dist-prod && webpack && webpack -p --output-path dist-prod --config webpack-prod.config.js && cd ../../", 47 | "demo": "npm run demo:auto-plugin-logic-filename && npm run demo:auto-plugin-react-typescript && npm run demo:auto-plugin && npm run demo:load-local-file && npm run demo:minify-html && npm run demo:config-resource && npm run demo:issue6 && npm run demo:out-html && npm run demo:use-template && npm run demo:use-template-complier && npm run demo:extract-css && npm run demo:public-path && npm run demo:pre-post-entrys && npm run demo:relative-path && npm run demo:relative-path-public-path && npm run demo:config-html-attribute && cd ../../", 48 | "test": "node test.js" 49 | }, 50 | "license": "ISC", 51 | "dependencies": { 52 | "file-type": "^8.1.0", 53 | "parse5": "^5.0.0", 54 | "webpack": "^5" 55 | }, 56 | "devDependencies": { 57 | "@types/react": "^16.4.7", 58 | "@types/react-dom": "^16.0.6", 59 | "css-loader": "^1.0.0", 60 | "ejs": "^2.6.1", 61 | "eslint": "^5.1.0", 62 | "file-loader": "^1.1.6", 63 | "html-minifier": "^3.5.18", 64 | "husky": "^0.14.3", 65 | "mini-css-extract-plugin": "^0.4.1", 66 | "react": "^16.4.2", 67 | "react-dom": "^16.4.2", 68 | "style-loader": "^0.21.0", 69 | "ts-loader": "^4.4.2", 70 | "tslib": "^1.9.3", 71 | "typescript": "^3.0.1", 72 | "webpack-cli": "^3.0.8", 73 | "webpack-dev-server": "^3.1.4" 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /demo/auto-plugin/dist/polyfill.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40 | /******/ } 41 | /******/ }; 42 | /******/ 43 | /******/ // define __esModule on exports 44 | /******/ __webpack_require__.r = function(exports) { 45 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47 | /******/ } 48 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 49 | /******/ }; 50 | /******/ 51 | /******/ // create a fake namespace object 52 | /******/ // mode & 1: value is a module id, require it 53 | /******/ // mode & 2: merge all properties of value into the ns 54 | /******/ // mode & 4: return value when already ns object 55 | /******/ // mode & 8|1: behave like require 56 | /******/ __webpack_require__.t = function(value, mode) { 57 | /******/ if(mode & 1) value = __webpack_require__(value); 58 | /******/ if(mode & 8) return value; 59 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60 | /******/ var ns = Object.create(null); 61 | /******/ __webpack_require__.r(ns); 62 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64 | /******/ return ns; 65 | /******/ }; 66 | /******/ 67 | /******/ // getDefaultExport function for compatibility with non-harmony modules 68 | /******/ __webpack_require__.n = function(module) { 69 | /******/ var getter = module && module.__esModule ? 70 | /******/ function getDefault() { return module['default']; } : 71 | /******/ function getModuleExports() { return module; }; 72 | /******/ __webpack_require__.d(getter, 'a', getter); 73 | /******/ return getter; 74 | /******/ }; 75 | /******/ 76 | /******/ // Object.prototype.hasOwnProperty.call 77 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78 | /******/ 79 | /******/ // __webpack_public_path__ 80 | /******/ __webpack_require__.p = "https://cdn.cn/"; 81 | /******/ 82 | /******/ 83 | /******/ // Load entry module and return exports 84 | /******/ return __webpack_require__(__webpack_require__.s = "./src/polyfill.js"); 85 | /******/ }) 86 | /************************************************************************/ 87 | /******/ ({ 88 | 89 | /***/ "./src/polyfill.js": 90 | /*!*************************!*\ 91 | !*** ./src/polyfill.js ***! 92 | \*************************/ 93 | /*! no static exports found */ 94 | /***/ (function(module, exports) { 95 | 96 | eval("alert('polyfill');\n\n\n//# sourceURL=webpack:///./src/polyfill.js?"); 97 | 98 | /***/ }) 99 | 100 | /******/ }); -------------------------------------------------------------------------------- /demo/auto-plugin/dist/ie_polyfill.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40 | /******/ } 41 | /******/ }; 42 | /******/ 43 | /******/ // define __esModule on exports 44 | /******/ __webpack_require__.r = function(exports) { 45 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47 | /******/ } 48 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 49 | /******/ }; 50 | /******/ 51 | /******/ // create a fake namespace object 52 | /******/ // mode & 1: value is a module id, require it 53 | /******/ // mode & 2: merge all properties of value into the ns 54 | /******/ // mode & 4: return value when already ns object 55 | /******/ // mode & 8|1: behave like require 56 | /******/ __webpack_require__.t = function(value, mode) { 57 | /******/ if(mode & 1) value = __webpack_require__(value); 58 | /******/ if(mode & 8) return value; 59 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60 | /******/ var ns = Object.create(null); 61 | /******/ __webpack_require__.r(ns); 62 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64 | /******/ return ns; 65 | /******/ }; 66 | /******/ 67 | /******/ // getDefaultExport function for compatibility with non-harmony modules 68 | /******/ __webpack_require__.n = function(module) { 69 | /******/ var getter = module && module.__esModule ? 70 | /******/ function getDefault() { return module['default']; } : 71 | /******/ function getModuleExports() { return module; }; 72 | /******/ __webpack_require__.d(getter, 'a', getter); 73 | /******/ return getter; 74 | /******/ }; 75 | /******/ 76 | /******/ // Object.prototype.hasOwnProperty.call 77 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78 | /******/ 79 | /******/ // __webpack_public_path__ 80 | /******/ __webpack_require__.p = "https://cdn.cn/"; 81 | /******/ 82 | /******/ 83 | /******/ // Load entry module and return exports 84 | /******/ return __webpack_require__(__webpack_require__.s = "./src/ie_polyfill.js"); 85 | /******/ }) 86 | /************************************************************************/ 87 | /******/ ({ 88 | 89 | /***/ "./src/ie_polyfill.js": 90 | /*!****************************!*\ 91 | !*** ./src/ie_polyfill.js ***! 92 | \****************************/ 93 | /*! no static exports found */ 94 | /***/ (function(module, exports) { 95 | 96 | eval("alert('ie_polyfill');\n\n\n//# sourceURL=webpack:///./src/ie_polyfill.js?"); 97 | 98 | /***/ }) 99 | 100 | /******/ }); -------------------------------------------------------------------------------- /demo/extract-css/dist/1.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40 | /******/ } 41 | /******/ }; 42 | /******/ 43 | /******/ // define __esModule on exports 44 | /******/ __webpack_require__.r = function(exports) { 45 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47 | /******/ } 48 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 49 | /******/ }; 50 | /******/ 51 | /******/ // create a fake namespace object 52 | /******/ // mode & 1: value is a module id, require it 53 | /******/ // mode & 2: merge all properties of value into the ns 54 | /******/ // mode & 4: return value when already ns object 55 | /******/ // mode & 8|1: behave like require 56 | /******/ __webpack_require__.t = function(value, mode) { 57 | /******/ if(mode & 1) value = __webpack_require__(value); 58 | /******/ if(mode & 8) return value; 59 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60 | /******/ var ns = Object.create(null); 61 | /******/ __webpack_require__.r(ns); 62 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64 | /******/ return ns; 65 | /******/ }; 66 | /******/ 67 | /******/ // getDefaultExport function for compatibility with non-harmony modules 68 | /******/ __webpack_require__.n = function(module) { 69 | /******/ var getter = module && module.__esModule ? 70 | /******/ function getDefault() { return module['default']; } : 71 | /******/ function getModuleExports() { return module; }; 72 | /******/ __webpack_require__.d(getter, 'a', getter); 73 | /******/ return getter; 74 | /******/ }; 75 | /******/ 76 | /******/ // Object.prototype.hasOwnProperty.call 77 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78 | /******/ 79 | /******/ // __webpack_public_path__ 80 | /******/ __webpack_require__.p = ""; 81 | /******/ 82 | /******/ 83 | /******/ // Load entry module and return exports 84 | /******/ return __webpack_require__(__webpack_require__.s = "./1.js"); 85 | /******/ }) 86 | /************************************************************************/ 87 | /******/ ({ 88 | 89 | /***/ "./1.css": 90 | /*!***************!*\ 91 | !*** ./1.css ***! 92 | \***************/ 93 | /*! no static exports found */ 94 | /***/ (function(module, exports, __webpack_require__) { 95 | 96 | eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack:///./1.css?"); 97 | 98 | /***/ }), 99 | 100 | /***/ "./1.js": 101 | /*!**************!*\ 102 | !*** ./1.js ***! 103 | \**************/ 104 | /*! no static exports found */ 105 | /***/ (function(module, exports, __webpack_require__) { 106 | 107 | eval("__webpack_require__(/*! ./1.css */ \"./1.css\");\nconsole.log('module 1');\n\n\n//# sourceURL=webpack:///./1.js?"); 108 | 109 | /***/ }) 110 | 111 | /******/ }); -------------------------------------------------------------------------------- /demo/extract-css/dist/2.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40 | /******/ } 41 | /******/ }; 42 | /******/ 43 | /******/ // define __esModule on exports 44 | /******/ __webpack_require__.r = function(exports) { 45 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47 | /******/ } 48 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 49 | /******/ }; 50 | /******/ 51 | /******/ // create a fake namespace object 52 | /******/ // mode & 1: value is a module id, require it 53 | /******/ // mode & 2: merge all properties of value into the ns 54 | /******/ // mode & 4: return value when already ns object 55 | /******/ // mode & 8|1: behave like require 56 | /******/ __webpack_require__.t = function(value, mode) { 57 | /******/ if(mode & 1) value = __webpack_require__(value); 58 | /******/ if(mode & 8) return value; 59 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60 | /******/ var ns = Object.create(null); 61 | /******/ __webpack_require__.r(ns); 62 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64 | /******/ return ns; 65 | /******/ }; 66 | /******/ 67 | /******/ // getDefaultExport function for compatibility with non-harmony modules 68 | /******/ __webpack_require__.n = function(module) { 69 | /******/ var getter = module && module.__esModule ? 70 | /******/ function getDefault() { return module['default']; } : 71 | /******/ function getModuleExports() { return module; }; 72 | /******/ __webpack_require__.d(getter, 'a', getter); 73 | /******/ return getter; 74 | /******/ }; 75 | /******/ 76 | /******/ // Object.prototype.hasOwnProperty.call 77 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78 | /******/ 79 | /******/ // __webpack_public_path__ 80 | /******/ __webpack_require__.p = ""; 81 | /******/ 82 | /******/ 83 | /******/ // Load entry module and return exports 84 | /******/ return __webpack_require__(__webpack_require__.s = "./2.js"); 85 | /******/ }) 86 | /************************************************************************/ 87 | /******/ ({ 88 | 89 | /***/ "./2.css": 90 | /*!***************!*\ 91 | !*** ./2.css ***! 92 | \***************/ 93 | /*! no static exports found */ 94 | /***/ (function(module, exports, __webpack_require__) { 95 | 96 | eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack:///./2.css?"); 97 | 98 | /***/ }), 99 | 100 | /***/ "./2.js": 101 | /*!**************!*\ 102 | !*** ./2.js ***! 103 | \**************/ 104 | /*! no static exports found */ 105 | /***/ (function(module, exports, __webpack_require__) { 106 | 107 | eval("__webpack_require__(/*! ./2.css */ \"./2.css\");\nconsole.log('module 2');\n\n\n//# sourceURL=webpack:///./2.js?"); 108 | 109 | /***/ }) 110 | 111 | /******/ }); -------------------------------------------------------------------------------- /demo/extract-css/dist/3.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40 | /******/ } 41 | /******/ }; 42 | /******/ 43 | /******/ // define __esModule on exports 44 | /******/ __webpack_require__.r = function(exports) { 45 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47 | /******/ } 48 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 49 | /******/ }; 50 | /******/ 51 | /******/ // create a fake namespace object 52 | /******/ // mode & 1: value is a module id, require it 53 | /******/ // mode & 2: merge all properties of value into the ns 54 | /******/ // mode & 4: return value when already ns object 55 | /******/ // mode & 8|1: behave like require 56 | /******/ __webpack_require__.t = function(value, mode) { 57 | /******/ if(mode & 1) value = __webpack_require__(value); 58 | /******/ if(mode & 8) return value; 59 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60 | /******/ var ns = Object.create(null); 61 | /******/ __webpack_require__.r(ns); 62 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64 | /******/ return ns; 65 | /******/ }; 66 | /******/ 67 | /******/ // getDefaultExport function for compatibility with non-harmony modules 68 | /******/ __webpack_require__.n = function(module) { 69 | /******/ var getter = module && module.__esModule ? 70 | /******/ function getDefault() { return module['default']; } : 71 | /******/ function getModuleExports() { return module; }; 72 | /******/ __webpack_require__.d(getter, 'a', getter); 73 | /******/ return getter; 74 | /******/ }; 75 | /******/ 76 | /******/ // Object.prototype.hasOwnProperty.call 77 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78 | /******/ 79 | /******/ // __webpack_public_path__ 80 | /******/ __webpack_require__.p = ""; 81 | /******/ 82 | /******/ 83 | /******/ // Load entry module and return exports 84 | /******/ return __webpack_require__(__webpack_require__.s = "./3.js"); 85 | /******/ }) 86 | /************************************************************************/ 87 | /******/ ({ 88 | 89 | /***/ "./3.css": 90 | /*!***************!*\ 91 | !*** ./3.css ***! 92 | \***************/ 93 | /*! no static exports found */ 94 | /***/ (function(module, exports, __webpack_require__) { 95 | 96 | eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack:///./3.css?"); 97 | 98 | /***/ }), 99 | 100 | /***/ "./3.js": 101 | /*!**************!*\ 102 | !*** ./3.js ***! 103 | \**************/ 104 | /*! no static exports found */ 105 | /***/ (function(module, exports, __webpack_require__) { 106 | 107 | eval("__webpack_require__(/*! ./3.css */ \"./3.css\");\nconsole.log('module 3');\n\n\n//# sourceURL=webpack:///./3.js?"); 108 | 109 | /***/ }) 110 | 111 | /******/ }); -------------------------------------------------------------------------------- /demo/extract-css/dist/4.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40 | /******/ } 41 | /******/ }; 42 | /******/ 43 | /******/ // define __esModule on exports 44 | /******/ __webpack_require__.r = function(exports) { 45 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47 | /******/ } 48 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 49 | /******/ }; 50 | /******/ 51 | /******/ // create a fake namespace object 52 | /******/ // mode & 1: value is a module id, require it 53 | /******/ // mode & 2: merge all properties of value into the ns 54 | /******/ // mode & 4: return value when already ns object 55 | /******/ // mode & 8|1: behave like require 56 | /******/ __webpack_require__.t = function(value, mode) { 57 | /******/ if(mode & 1) value = __webpack_require__(value); 58 | /******/ if(mode & 8) return value; 59 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60 | /******/ var ns = Object.create(null); 61 | /******/ __webpack_require__.r(ns); 62 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64 | /******/ return ns; 65 | /******/ }; 66 | /******/ 67 | /******/ // getDefaultExport function for compatibility with non-harmony modules 68 | /******/ __webpack_require__.n = function(module) { 69 | /******/ var getter = module && module.__esModule ? 70 | /******/ function getDefault() { return module['default']; } : 71 | /******/ function getModuleExports() { return module; }; 72 | /******/ __webpack_require__.d(getter, 'a', getter); 73 | /******/ return getter; 74 | /******/ }; 75 | /******/ 76 | /******/ // Object.prototype.hasOwnProperty.call 77 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78 | /******/ 79 | /******/ // __webpack_public_path__ 80 | /******/ __webpack_require__.p = ""; 81 | /******/ 82 | /******/ 83 | /******/ // Load entry module and return exports 84 | /******/ return __webpack_require__(__webpack_require__.s = "./4.js"); 85 | /******/ }) 86 | /************************************************************************/ 87 | /******/ ({ 88 | 89 | /***/ "./4.css": 90 | /*!***************!*\ 91 | !*** ./4.css ***! 92 | \***************/ 93 | /*! no static exports found */ 94 | /***/ (function(module, exports, __webpack_require__) { 95 | 96 | eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack:///./4.css?"); 97 | 98 | /***/ }), 99 | 100 | /***/ "./4.js": 101 | /*!**************!*\ 102 | !*** ./4.js ***! 103 | \**************/ 104 | /*! no static exports found */ 105 | /***/ (function(module, exports, __webpack_require__) { 106 | 107 | eval("__webpack_require__(/*! ./4.css */ \"./4.css\");\nconsole.log('module 4');\n\n\n//# sourceURL=webpack:///./4.js?"); 108 | 109 | /***/ }) 110 | 111 | /******/ }); -------------------------------------------------------------------------------- /demo/auto-plugin-pagedir-object/dist/home.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40 | /******/ } 41 | /******/ }; 42 | /******/ 43 | /******/ // define __esModule on exports 44 | /******/ __webpack_require__.r = function(exports) { 45 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47 | /******/ } 48 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 49 | /******/ }; 50 | /******/ 51 | /******/ // create a fake namespace object 52 | /******/ // mode & 1: value is a module id, require it 53 | /******/ // mode & 2: merge all properties of value into the ns 54 | /******/ // mode & 4: return value when already ns object 55 | /******/ // mode & 8|1: behave like require 56 | /******/ __webpack_require__.t = function(value, mode) { 57 | /******/ if(mode & 1) value = __webpack_require__(value); 58 | /******/ if(mode & 8) return value; 59 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60 | /******/ var ns = Object.create(null); 61 | /******/ __webpack_require__.r(ns); 62 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64 | /******/ return ns; 65 | /******/ }; 66 | /******/ 67 | /******/ // getDefaultExport function for compatibility with non-harmony modules 68 | /******/ __webpack_require__.n = function(module) { 69 | /******/ var getter = module && module.__esModule ? 70 | /******/ function getDefault() { return module['default']; } : 71 | /******/ function getModuleExports() { return module; }; 72 | /******/ __webpack_require__.d(getter, 'a', getter); 73 | /******/ return getter; 74 | /******/ }; 75 | /******/ 76 | /******/ // Object.prototype.hasOwnProperty.call 77 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78 | /******/ 79 | /******/ // __webpack_public_path__ 80 | /******/ __webpack_require__.p = "https://cdn.cn/"; 81 | /******/ 82 | /******/ 83 | /******/ // Load entry module and return exports 84 | /******/ return __webpack_require__(__webpack_require__.s = 0); 85 | /******/ }) 86 | /************************************************************************/ 87 | /******/ ({ 88 | 89 | /***/ "./src/home/index.css": 90 | /*!****************************!*\ 91 | !*** ./src/home/index.css ***! 92 | \****************************/ 93 | /*! no static exports found */ 94 | /***/ (function(module, exports, __webpack_require__) { 95 | 96 | eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack:///./src/home/index.css?"); 97 | 98 | /***/ }), 99 | 100 | /***/ "./src/home/index.js": 101 | /*!***************************!*\ 102 | !*** ./src/home/index.js ***! 103 | \***************************/ 104 | /*! no static exports found */ 105 | /***/ (function(module, exports, __webpack_require__) { 106 | 107 | eval("__webpack_require__(/*! ./index.css */ \"./src/home/index.css\");\nalert('page home');\n\n\n//# sourceURL=webpack:///./src/home/index.js?"); 108 | 109 | /***/ }), 110 | 111 | /***/ 0: 112 | /*!************************!*\ 113 | !*** multi ./src/home ***! 114 | \************************/ 115 | /*! no static exports found */ 116 | /***/ (function(module, exports, __webpack_require__) { 117 | 118 | eval("module.exports = __webpack_require__(/*! /Users/halwu/WebstormProjects/web-webpack-plugin/demo/auto-plugin-pagedir-object/src/home */\"./src/home/index.js\");\n\n\n//# sourceURL=webpack:///multi_./src/home?"); 119 | 120 | /***/ }) 121 | 122 | /******/ }); -------------------------------------------------------------------------------- /demo/auto-plugin-pagedir-object/dist/login.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // The module cache 3 | /******/ var installedModules = {}; 4 | /******/ 5 | /******/ // The require function 6 | /******/ function __webpack_require__(moduleId) { 7 | /******/ 8 | /******/ // Check if module is in cache 9 | /******/ if(installedModules[moduleId]) { 10 | /******/ return installedModules[moduleId].exports; 11 | /******/ } 12 | /******/ // Create a new module (and put it into the cache) 13 | /******/ var module = installedModules[moduleId] = { 14 | /******/ i: moduleId, 15 | /******/ l: false, 16 | /******/ exports: {} 17 | /******/ }; 18 | /******/ 19 | /******/ // Execute the module function 20 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 | /******/ 22 | /******/ // Flag the module as loaded 23 | /******/ module.l = true; 24 | /******/ 25 | /******/ // Return the exports of the module 26 | /******/ return module.exports; 27 | /******/ } 28 | /******/ 29 | /******/ 30 | /******/ // expose the modules object (__webpack_modules__) 31 | /******/ __webpack_require__.m = modules; 32 | /******/ 33 | /******/ // expose the module cache 34 | /******/ __webpack_require__.c = installedModules; 35 | /******/ 36 | /******/ // define getter function for harmony exports 37 | /******/ __webpack_require__.d = function(exports, name, getter) { 38 | /******/ if(!__webpack_require__.o(exports, name)) { 39 | /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40 | /******/ } 41 | /******/ }; 42 | /******/ 43 | /******/ // define __esModule on exports 44 | /******/ __webpack_require__.r = function(exports) { 45 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47 | /******/ } 48 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 49 | /******/ }; 50 | /******/ 51 | /******/ // create a fake namespace object 52 | /******/ // mode & 1: value is a module id, require it 53 | /******/ // mode & 2: merge all properties of value into the ns 54 | /******/ // mode & 4: return value when already ns object 55 | /******/ // mode & 8|1: behave like require 56 | /******/ __webpack_require__.t = function(value, mode) { 57 | /******/ if(mode & 1) value = __webpack_require__(value); 58 | /******/ if(mode & 8) return value; 59 | /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60 | /******/ var ns = Object.create(null); 61 | /******/ __webpack_require__.r(ns); 62 | /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63 | /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64 | /******/ return ns; 65 | /******/ }; 66 | /******/ 67 | /******/ // getDefaultExport function for compatibility with non-harmony modules 68 | /******/ __webpack_require__.n = function(module) { 69 | /******/ var getter = module && module.__esModule ? 70 | /******/ function getDefault() { return module['default']; } : 71 | /******/ function getModuleExports() { return module; }; 72 | /******/ __webpack_require__.d(getter, 'a', getter); 73 | /******/ return getter; 74 | /******/ }; 75 | /******/ 76 | /******/ // Object.prototype.hasOwnProperty.call 77 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78 | /******/ 79 | /******/ // __webpack_public_path__ 80 | /******/ __webpack_require__.p = "https://cdn.cn/"; 81 | /******/ 82 | /******/ 83 | /******/ // Load entry module and return exports 84 | /******/ return __webpack_require__(__webpack_require__.s = 2); 85 | /******/ }) 86 | /************************************************************************/ 87 | /******/ ({ 88 | 89 | /***/ "./src/login/index.css": 90 | /*!*****************************!*\ 91 | !*** ./src/login/index.css ***! 92 | \*****************************/ 93 | /*! no static exports found */ 94 | /***/ (function(module, exports, __webpack_require__) { 95 | 96 | eval("// extracted by mini-css-extract-plugin\n\n//# sourceURL=webpack:///./src/login/index.css?"); 97 | 98 | /***/ }), 99 | 100 | /***/ "./src/login/index.js": 101 | /*!****************************!*\ 102 | !*** ./src/login/index.js ***! 103 | \****************************/ 104 | /*! no static exports found */ 105 | /***/ (function(module, exports, __webpack_require__) { 106 | 107 | eval("__webpack_require__(/*! ./index.css */ \"./src/login/index.css\");\nalert('page login');\n\n\n//# sourceURL=webpack:///./src/login/index.js?"); 108 | 109 | /***/ }), 110 | 111 | /***/ 2: 112 | /*!*************************!*\ 113 | !*** multi ./src/login ***! 114 | \*************************/ 115 | /*! no static exports found */ 116 | /***/ (function(module, exports, __webpack_require__) { 117 | 118 | eval("module.exports = __webpack_require__(/*! /Users/halwu/WebstormProjects/web-webpack-plugin/demo/auto-plugin-pagedir-object/src/login */\"./src/login/index.js\");\n\n\n//# sourceURL=webpack:///multi_./src/login?"); 119 | 120 | /***/ }) 121 | 122 | /******/ }); --------------------------------------------------------------------------------