bash: Thu Nov 7 18:14:56 CST 2019

master
ubuntu 5 years ago
parent 64a3098c79
commit 6837e1bca8
  1. 6
      README.md
  2. 2
      dist/css/bundle.css
  3. 0
      dist/functions.php
  4. 2
      dist/index.html
  5. 139
      dist/index.php
  6. 1
      dist/manifest.json
  7. 12
      dist/style.css
  8. 91
      package-lock.json
  9. 2
      package.json
  10. 2
      src/index.html
  11. 12
      src/package.less
  12. 0
      src/php/functions.php
  13. 139
      src/php/index.php
  14. 67
      webpack.config.js

@ -10,16 +10,12 @@ I'll build the basical templates here, the stylesheets and scripts in `dist` fol
```bash
npm i -g webpack-cli
npm install
# copy image
cp -r ./src/images ./dist
# or
./do.sh
# Run dev server
npm start
# Build
npm run build
```
Dev server on <http://localhost:8080/>, also host on your public IP, check firewall!
__Commands must run under Linux!__ Dev server on <http://localhost:8080/>, also host on your public IP, check firewall!
[Notes](./NOTES.md)

File diff suppressed because one or more lines are too long

2
dist/index.html vendored

@ -56,7 +56,7 @@
<div class="post-info">
<div class="text">
<h4 class="mdc-typography mdc-typography--subtitle1 post-date">
<i class="iconfont icon-time"></i> Posted on 2018-05-25 <i class="iconfont hotpost icon-hot"></i>
<i class="iconfont icon-time"></i> Posted on 2019-05-25 <i class="iconfont hotpost icon-hot"></i>
</h4>
<h3 class="mdc-typography mdc-typography--headline5 post-title">
Our Changing Planet

139
dist/index.php vendored

@ -0,0 +1,139 @@
<!DOCTYPE html>
<html>
<head>
<title>Sakura v2</title>
<link rel="stylesheet" href="./css/bundle.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_679578_dgipmwt51qb.css">
<script src="./js/bundle.js" async></script>
</head>
<body>
<div id="root" class="root">
<!--page main content (async container)-->
<header id="nav-header" class="mdc-top-app-bar mdc-top-app-bar--dense">
<!--nav mune-->
<div class="mdc-top-app-bar__row">
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start">
<button class="material-icons mdc-top-app-bar__navigation-icon mdc-icon-button">menu</button>
<span class="mdc-top-app-bar__title">Sakura</span>
</section>
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" role="toolbar">
<a href="./" class="material-icons mdc-top-app-bar__action-item mdc-icon-button">home</a>
<a href="#" class="material-icons mdc-top-app-bar__action-item mdc-icon-button">print</a>
<a href="#" class="material-icons mdc-top-app-bar__action-item mdc-icon-button">bookmark</a>
</section>
</div>
</header>
<div class="header-top">
<!--index cover image-->
<figure data="mark" id="cover-img-container">
<div data="layer" id="img-view" data-depth="0.5">
<img data="cover" id="cover-img" src="https://view.moezx.cc/images/2019/10/21/1zuypi4mkggq6js5lqxt3sjaa.jpg">
</div>
</figure>
<div class="cover-video-container"></div>
</div>
<!--transparent area-->
<div id="header-top-after" class="header-top-after">
<!--wave decoration-->
<div id="header-top-after-deco" class="header-top-after-deco"></div>
</div>
<div class="page-content">
<aside class="side-bar-left">left</aside>
<section class="main-center">
<div class="post-list">
<!--post thumb list-->
<!--thumb right template-->
<div class="mdc-card post-thumb-item">
<div class="mdc-card__primary-action mdc-ripple-upgraded primary-action">
<div class="content">
<div class="post-info">
<div class="text">
<h4 class="mdc-typography mdc-typography--subtitle1 post-date">
<i class="iconfont icon-time"></i> Posted on 2018-05-25 <i class="iconfont hotpost icon-hot"></i>
</h4>
<h3 class="mdc-typography mdc-typography--headline5 post-title">
Our Changing Planet
</h3>
<h4 class="mdc-typography mdc-typography--subtitle1 post-meta">
<i class="iconfont icon-attention"></i> 8 332 Hits
<i class="iconfont icon-mark"></i> 26 Comments
<i class="iconfont icon-file"></i> Child
</h4>
<div class="mdc-typography mdc-typography--body2 post-abstract">
Visit ten places on our planet that are undergoing the biggest changes
today.
</div>
</div>
<div class="btn--align-left">
<a href="./single.html" class="mdc-button mdc-button--outlined">Read</a>
</div>
</div>
<div class="post-thumb">
<div href="#" class="thumb-img-box">
<img src="https://view.moezx.cc/images/2019/10/21/5e65o9lxtbvht2tdjvpgsmarw.jpg">
</div>
</div>
</div>
</div>
</div>
<!--thumb right template end-->
<!--thumb left template-->
<div class="mdc-card post-thumb-item">
<div class="mdc-card__primary-action mdc-ripple-upgraded primary-action">
<div class="content">
<div class="post-thumb">
<div href="#" class="thumb-img-box">
<img src="https://view.moezx.cc/images/2019/10/21/1owb0inchnbrhkamrpk10a2ff.jpg">
</div>
</div>
<div class="post-info">
<div class="text">
<h4 class="mdc-typography mdc-typography--subtitle1 post-date">
<i class="iconfont icon-time"></i> Posted on 2018-05-25 <i class="iconfont hotpost icon-hot"></i>
</h4>
<h3 class="mdc-typography mdc-typography--headline5 post-title">
Our Changing Planet
</h3>
<h4 class="mdc-typography mdc-typography--subtitle1 post-meta">
<i class="iconfont icon-attention"></i> 8 332 Hits
<i class="iconfont icon-mark"></i> 26 Comments
<i class="iconfont icon-file"></i> Child
</h4>
<div class="mdc-typography mdc-typography--body2 post-abstract">
Visit ten places on our planet that are undergoing the biggest changes
today.
</div>
</div>
<div class="btn--align-right">
<a href="./single.html" class="mdc-button mdc-button--outlined">Read</a>
</div>
</div>
</div>
</div>
</div>
<!--thumb left template end-->
<!--post-list end-->
</section>
<aside class="side-bar-right">right</aside>
</div>
<footer>
<div class="before" id="footer-before"></div>
<div class="main">Copyright</div>
</footer>
</div>
</body>
</html>

@ -0,0 +1 @@
{"main":{"css":["./css/bundle.css"],"js":["./js/bundle.js"]}}

12
dist/style.css vendored

@ -0,0 +1,12 @@
/*!
* Theme Name: Sakura
* Theme URI: https://2heng.xin
* Description: A Wonderful WordPress Theme Sakura 🌸
* Version: 4.0.0
* Author: Mashiro
* Author URI: https://2heng.xin
* Tags: HTML5, CSS3, Webpack, framework
*
* License: MIT
* License URI: http://opensource.org/licenses/mit-license.php
*/

91
package-lock.json generated

@ -1902,6 +1902,11 @@
"resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
"integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c="
},
"ast-types": {
"version": "0.9.6",
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.9.6.tgz",
"integrity": "sha1-ECyenpAF0+fjgpvwxPok7oYu6bk="
},
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
@ -2390,7 +2395,6 @@
"version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/camel-case/download/camel-case-3.0.0.tgz",
"integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=",
"dev": true,
"requires": {
"no-case": "^2.2.0",
"upper-case": "^1.1.1"
@ -2480,6 +2484,11 @@
"tslib": "^1.9.0"
}
},
"chunks-2-json-webpack-plugin": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/chunks-2-json-webpack-plugin/-/chunks-2-json-webpack-plugin-1.0.2.tgz",
"integrity": "sha512-SJupWpTR5gCoEhYWfAb6gUPJc192BLeeDeZ6NitjxKEALiYGv3+I6RbwgSsTuUhHY1q5i1HPQuLRPaC+d1p77w=="
},
"cipher-base": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
@ -2514,7 +2523,6 @@
"version": "4.2.1",
"resolved": "https://registry.npm.taobao.org/clean-css/download/clean-css-4.2.1.tgz",
"integrity": "sha1-LUEe92uFabbQyEBo2r6FsKpeXBc=",
"dev": true,
"requires": {
"source-map": "~0.6.0"
}
@ -3672,6 +3680,15 @@
"ext": "^1.1.2"
}
},
"es6-templates": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/es6-templates/-/es6-templates-0.2.3.tgz",
"integrity": "sha1-XLmsn7He1usSOTQrgdeSu7QHjuQ=",
"requires": {
"recast": "~0.11.12",
"through": "~2.3.6"
}
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
@ -4050,6 +4067,11 @@
"loader-utils": "^1.1.0"
}
},
"fastparse": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz",
"integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ=="
},
"faye-websocket": {
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz",
@ -5068,8 +5090,7 @@
"he": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/he/download/he-1.2.0.tgz",
"integrity": "sha1-hK5l+n6vsWX922FWauFLrwVmTw8=",
"dev": true
"integrity": "sha1-hK5l+n6vsWX922FWauFLrwVmTw8="
},
"hmac-drbg": {
"version": "1.0.1",
@ -5110,11 +5131,22 @@
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz",
"integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8="
},
"html-loader": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/html-loader/-/html-loader-0.5.5.tgz",
"integrity": "sha512-7hIW7YinOYUpo//kSYcPB6dCKoceKLmOwjEMmhIobHuWGDVl0Nwe4l68mdG/Ru0wcUxQjVMEoZpkalZ/SE7zog==",
"requires": {
"es6-templates": "^0.2.3",
"fastparse": "^1.1.1",
"html-minifier": "^3.5.8",
"loader-utils": "^1.1.0",
"object-assign": "^4.1.1"
}
},
"html-minifier": {
"version": "3.5.21",
"resolved": "https://registry.npm.taobao.org/html-minifier/download/html-minifier-3.5.21.tgz",
"integrity": "sha1-0AQOBUcw41TbAIRjWTGUAVIS0gw=",
"dev": true,
"requires": {
"camel-case": "3.0.x",
"clean-css": "4.2.x",
@ -5128,14 +5160,12 @@
"commander": {
"version": "2.17.1",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1572603184853&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz",
"integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78=",
"dev": true
"integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78="
},
"uglify-js": {
"version": "3.4.10",
"resolved": "https://registry.npm.taobao.org/uglify-js/download/uglify-js-3.4.10.tgz",
"integrity": "sha1-mtlWPY6zrN+404WX0q8dgV9qdV8=",
"dev": true,
"requires": {
"commander": "~2.19.0",
"source-map": "~0.6.1"
@ -5144,8 +5174,7 @@
"commander": {
"version": "2.19.0",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.19.0.tgz?cache=0&sync_timestamp=1572603184853&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.19.0.tgz",
"integrity": "sha1-9hmKqE5bg8RgVLlN3tv+1e6f8So=",
"dev": true
"integrity": "sha1-9hmKqE5bg8RgVLlN3tv+1e6f8So="
}
}
}
@ -5912,8 +5941,7 @@
"lower-case": {
"version": "1.1.4",
"resolved": "https://registry.npm.taobao.org/lower-case/download/lower-case-1.1.4.tgz",
"integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=",
"dev": true
"integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw="
},
"lru-cache": {
"version": "4.1.5",
@ -6378,7 +6406,6 @@
"version": "2.3.2",
"resolved": "https://registry.npm.taobao.org/no-case/download/no-case-2.3.2.tgz",
"integrity": "sha1-YLgTOWvjmz8SiKTB7V0efSi0ZKw=",
"dev": true,
"requires": {
"lower-case": "^1.1.1"
}
@ -6855,7 +6882,6 @@
"version": "2.1.1",
"resolved": "https://registry.npm.taobao.org/param-case/download/param-case-2.1.1.tgz",
"integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=",
"dev": true,
"requires": {
"no-case": "^2.2.0"
}
@ -7190,8 +7216,7 @@
"private": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
"integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==",
"dev": true
"integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg=="
},
"process": {
"version": "0.11.10",
@ -7418,6 +7443,29 @@
"readable-stream": "^2.0.2"
}
},
"recast": {
"version": "0.11.23",
"resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz",
"integrity": "sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM=",
"requires": {
"ast-types": "0.9.6",
"esprima": "~3.1.0",
"private": "~0.1.5",
"source-map": "~0.5.0"
},
"dependencies": {
"esprima": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz",
"integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM="
},
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
}
}
},
"redent": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz",
@ -7527,8 +7575,7 @@
"relateurl": {
"version": "0.2.7",
"resolved": "https://registry.npm.taobao.org/relateurl/download/relateurl-0.2.7.tgz",
"integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=",
"dev": true
"integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk="
},
"remove-trailing-separator": {
"version": "1.1.0",
@ -8669,6 +8716,11 @@
}
}
},
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"through2": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
@ -9048,8 +9100,7 @@
"upper-case": {
"version": "1.1.3",
"resolved": "https://registry.npm.taobao.org/upper-case/download/upper-case-1.1.3.tgz",
"integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
"dev": true
"integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg="
},
"uri-js": {
"version": "4.2.2",

@ -13,11 +13,13 @@
"@material/ripple": "^3.2.0",
"@material/textfield": "^3.2.0",
"@material/theme": "^3.1.0",
"chunks-2-json-webpack-plugin": "^1.0.2",
"cpx": "^1.5.0",
"cross-env": "^6.0.3",
"css-loader": "^3.2.0",
"extract-loader": "^3.1.0",
"file-loader": "^4.2.0",
"html-loader": "^0.5.5",
"material-components-web": "^3.2.0",
"node-sass": "^4.13.0",
"parallax-js": "^3.1.0",

@ -56,7 +56,7 @@
<div class="post-info">
<div class="text">
<h4 class="mdc-typography mdc-typography--subtitle1 post-date">
<i class="iconfont icon-time"></i> Posted on 2018-05-25 <i class="iconfont hotpost icon-hot"></i>
<i class="iconfont icon-time"></i> Posted on 2019-05-25 <i class="iconfont hotpost icon-hot"></i>
</h4>
<h3 class="mdc-typography mdc-typography--headline5 post-title">
Our Changing Planet

@ -0,0 +1,12 @@
/*!
* Theme Name: Sakura
* Theme URI: https://2heng.xin
* Description: A Wonderful WordPress Theme Sakura 🌸
* Version: 4.0.0
* Author: Mashiro
* Author URI: https://2heng.xin
* Tags: HTML5, CSS3, Webpack, framework
*
* License: MIT
* License URI: http://opensource.org/licenses/mit-license.php
*/

@ -0,0 +1,139 @@
<!DOCTYPE html>
<html>
<head>
<title>Sakura v2</title>
<link rel="stylesheet" href="./css/bundle.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_679578_dgipmwt51qb.css">
<script src="./js/bundle.js" async></script>
</head>
<body>
<div id="root" class="root">
<!--page main content (async container)-->
<header id="nav-header" class="mdc-top-app-bar mdc-top-app-bar--dense">
<!--nav mune-->
<div class="mdc-top-app-bar__row">
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start">
<button class="material-icons mdc-top-app-bar__navigation-icon mdc-icon-button">menu</button>
<span class="mdc-top-app-bar__title">Sakura</span>
</section>
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" role="toolbar">
<a href="./" class="material-icons mdc-top-app-bar__action-item mdc-icon-button">home</a>
<a href="#" class="material-icons mdc-top-app-bar__action-item mdc-icon-button">print</a>
<a href="#" class="material-icons mdc-top-app-bar__action-item mdc-icon-button">bookmark</a>
</section>
</div>
</header>
<div class="header-top">
<!--index cover image-->
<figure data="mark" id="cover-img-container">
<div data="layer" id="img-view" data-depth="0.5">
<img data="cover" id="cover-img" src="https://view.moezx.cc/images/2019/10/21/1zuypi4mkggq6js5lqxt3sjaa.jpg">
</div>
</figure>
<div class="cover-video-container"></div>
</div>
<!--transparent area-->
<div id="header-top-after" class="header-top-after">
<!--wave decoration-->
<div id="header-top-after-deco" class="header-top-after-deco"></div>
</div>
<div class="page-content">
<aside class="side-bar-left">left</aside>
<section class="main-center">
<div class="post-list">
<!--post thumb list-->
<!--thumb right template-->
<div class="mdc-card post-thumb-item">
<div class="mdc-card__primary-action mdc-ripple-upgraded primary-action">
<div class="content">
<div class="post-info">
<div class="text">
<h4 class="mdc-typography mdc-typography--subtitle1 post-date">
<i class="iconfont icon-time"></i> Posted on 2018-05-25 <i class="iconfont hotpost icon-hot"></i>
</h4>
<h3 class="mdc-typography mdc-typography--headline5 post-title">
Our Changing Planet
</h3>
<h4 class="mdc-typography mdc-typography--subtitle1 post-meta">
<i class="iconfont icon-attention"></i> 8 332 Hits
<i class="iconfont icon-mark"></i> 26 Comments
<i class="iconfont icon-file"></i> Child
</h4>
<div class="mdc-typography mdc-typography--body2 post-abstract">
Visit ten places on our planet that are undergoing the biggest changes
today.
</div>
</div>
<div class="btn--align-left">
<a href="./single.html" class="mdc-button mdc-button--outlined">Read</a>
</div>
</div>
<div class="post-thumb">
<div href="#" class="thumb-img-box">
<img src="https://view.moezx.cc/images/2019/10/21/5e65o9lxtbvht2tdjvpgsmarw.jpg">
</div>
</div>
</div>
</div>
</div>
<!--thumb right template end-->
<!--thumb left template-->
<div class="mdc-card post-thumb-item">
<div class="mdc-card__primary-action mdc-ripple-upgraded primary-action">
<div class="content">
<div class="post-thumb">
<div href="#" class="thumb-img-box">
<img src="https://view.moezx.cc/images/2019/10/21/1owb0inchnbrhkamrpk10a2ff.jpg">
</div>
</div>
<div class="post-info">
<div class="text">
<h4 class="mdc-typography mdc-typography--subtitle1 post-date">
<i class="iconfont icon-time"></i> Posted on 2018-05-25 <i class="iconfont hotpost icon-hot"></i>
</h4>
<h3 class="mdc-typography mdc-typography--headline5 post-title">
Our Changing Planet
</h3>
<h4 class="mdc-typography mdc-typography--subtitle1 post-meta">
<i class="iconfont icon-attention"></i> 8 332 Hits
<i class="iconfont icon-mark"></i> 26 Comments
<i class="iconfont icon-file"></i> Child
</h4>
<div class="mdc-typography mdc-typography--body2 post-abstract">
Visit ten places on our planet that are undergoing the biggest changes
today.
</div>
</div>
<div class="btn--align-right">
<a href="./single.html" class="mdc-button mdc-button--outlined">Read</a>
</div>
</div>
</div>
</div>
</div>
<!--thumb left template end-->
<!--post-list end-->
</section>
<aside class="side-bar-right">right</aside>
</div>
<footer>
<div class="before" id="footer-before"></div>
<div class="main">Copyright</div>
</footer>
</div>
</body>
</html>

@ -1,12 +1,11 @@
const path = require('path');
const autoprefixer = require('autoprefixer');
const TerserPlugin = require('terser-webpack-plugin');
// const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const Chunks2JsonPlugin = require('chunks-2-json-webpack-plugin');
// still not work...
// const imgOutputPath = process.env.ENV_MODE === "build" ? 'images/[name].[ext]' : '../images/[name].[ext]';
// const OutputPath = process.env.ENV_MODE
module.exports = [{
mode: "development", // "production" | "development" | "none"
@ -19,13 +18,13 @@ module.exports = [{
},
devtool: 'inline-source-map',
devServer: {
contentBase: path.join(__dirname, './dist'), //编译打包文件的位置
contentBase: path.join(__dirname, './dist'),
publicPath: '/',
port: 8080, //服务器端口号
port: 8080,
host: '0.0.0.0',
// proxy: {}, //代理列表
// proxy: {},
compress: true,
// historyApiFallback: true, //开启服务器history重定向模式
// historyApiFallback: true,
},
module: {
rules: [{
@ -46,27 +45,8 @@ module.exports = [{
},
{
test: /\.scss$/,
use: [
// no need with MiniCssExtractPlugin
// {
// loader: 'file-loader',
// options: {
// name: './css/bundle.css',
// // outputPath: './css',
// },
// },
// bug with file-loader: https://github.com/webpack-contrib/css-loader/issues/864#issuecomment-445815198
// {
// loader: 'extract-loader'
// },
{
loader: MiniCssExtractPlugin.loader,
// options: {
// // you can specify a publicPath here
// // by default it uses publicPath in webpackOptions.output
// publicPath: '../',
// hmr: process.env.NODE_ENV === 'development',
// },
use: [{
loader: MiniCssExtractPlugin.loader
},
{
loader: 'css-loader'
@ -97,7 +77,7 @@ module.exports = [{
},
}, ],
exclude: /node_modules/
},
}
]
},
resolve: {
@ -111,28 +91,31 @@ module.exports = [{
// },
plugins: [
new CopyPlugin([
// { from: './src/images', to: './images' },
{
from: './src/package.less',
to: './style.css',
toType: 'file',
},
{
from: './src/*.html',
to: './[name].[ext]',
toType: 'template',
},
{
from: './src/php/*.php',
to: './[name].[ext]',
toType: 'template',
}
]),
// new HtmlWebpackPlugin({
// filename: 'index.html',
// template: './src/index.html',
// chunks: ['index']
// }),
// new HtmlWebpackPlugin({
// filename: 'single.html',
// template: './src/single.html',
// chunks: ['single']
// })
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename: "css/bundle.css",
filename: "./css/bundle.css",
// chunkFilename: "[id].css"
}),
new Chunks2JsonPlugin({
outputDir: 'dist/',
filename: 'manifest.json'
})
]
],
}];
Loading…
Cancel
Save