All Projects → znlbwo → Webpack Multi Page

znlbwo / Webpack Multi Page

Licence: mit
webpack 前端多页项目工程

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Webpack Multi Page

Devopenclub Tech Webpack2
Webpack 2 视频教程课程源码
Stars: ✭ 148 (-3.27%)
Mutual labels:  webpack
Easyfun
a project using react antd webpack es6
Stars: ✭ 150 (-1.96%)
Mutual labels:  webpack
Reactql
Universal React+GraphQL starter kit: React 16, Apollo 2, MobX, Emotion, Webpack 4, GraphQL Code Generator, React Router 4, PostCSS, SSR
Stars: ✭ 1,833 (+1098.04%)
Mutual labels:  webpack
Generator Phaser Plus
[🛑 DISCONTINUED] It has been a long journey but development of `generator-phaser-plus` is now over. I recommend you have a look and fork `yandeu/phaser-project-template` instead.
Stars: ✭ 148 (-3.27%)
Mutual labels:  webpack
Webpack Babel Multi Target Plugin
A Webpack plugin that works with Babel to allow differential loading - production deployment of ES2015 builds targeted to modern browsers, with an ES5 fallback for legacy browsers.
Stars: ✭ 150 (-1.96%)
Mutual labels:  webpack
Workflow Reactjs
My workflow with ReactJS + Webpack 3+
Stars: ✭ 150 (-1.96%)
Mutual labels:  webpack
Obsolete Webpack Plugin
🌈 A Webpack plugin generates a browser-side standalone script that detects browser compatibility based on `Browserslist` and prompts website users to upgrade it.
Stars: ✭ 148 (-3.27%)
Mutual labels:  webpack
Blog
浩麟的技术博客
Stars: ✭ 2,002 (+1208.5%)
Mutual labels:  webpack
Kirby Webpack
💪 A Kirby CMS starter-kit with modern frontend tools
Stars: ✭ 150 (-1.96%)
Mutual labels:  webpack
Clean Webpack Plugin
By default, this plugin will remove all files inside webpack's output.path directory, as well as all unused webpack assets after every successful rebuild.
Stars: ✭ 1,888 (+1133.99%)
Mutual labels:  webpack
Word2vec Spam Filter
Using word vectors to classify spam messages
Stars: ✭ 149 (-2.61%)
Mutual labels:  webpack
Pixi Seed
Pixi.js project seed with ES6 and webpack
Stars: ✭ 149 (-2.61%)
Mutual labels:  webpack
Angularjs Typescript Webpack
AngularJS 1.7, typescript 3 and webpack 4 starter project based on angular tutorial
Stars: ✭ 150 (-1.96%)
Mutual labels:  webpack
Angular1 Webpack Starter
Component based Angular(1.x) web development with Webpack and ES6.
Stars: ✭ 148 (-3.27%)
Mutual labels:  webpack
File Loader
File Loader
Stars: ✭ 1,846 (+1106.54%)
Mutual labels:  webpack
Vue Shop
VUE移动小商城
Stars: ✭ 148 (-3.27%)
Mutual labels:  webpack
Spring Boot Angular4 Boilerplate
Quickstart for spring boot + angular 4 projects
Stars: ✭ 151 (-1.31%)
Mutual labels:  webpack
Terminal In React
👨‍💻 A component that renders a terminal
Stars: ✭ 1,939 (+1167.32%)
Mutual labels:  webpack
Babel Plugin Webpack Alias
babel 6 plugin which allows to use webpack resolve options
Stars: ✭ 151 (-1.31%)
Mutual labels:  webpack
Vue Webpack Config
Koa2、Webpack、Vue、React、Node
Stars: ✭ 151 (-1.31%)
Mutual labels:  webpack

webpack-multi-page

基于 webpack v4 的前端多页项目工程,适用于展示型站点,比如官网。

特性

  • 支持 ES6+ 语法,使用 babel 编译,预设 preset-env

  • html 支持 ejs 语法,使用 underscore-template-loaderHtmlWebpackPlugin 编译,详细语法可查看 underscore 或者 lodash _.template 函数部分。另外 underscore-template-loader 提供 Macros (宏) 的特性可自定义静态内容,内置 require 宏可在页面 html 文件内引入公共 html 组件,比如 header、footer 之类多页面公共组件,并且可以提供参数给组件;

  • 已内置第三方 css 库 [email protected]^8.0.1 和 js 库 [email protected]^3.5.1 可全局使用,无需声明引入;

  • html、css、js 文件内资源引用全部使用相对路径并且会自动判断是否转为 base64 格式;

  • 支持 css autoprefixer,无需手写浏览器兼容;支持 css @import 语法;

  • 打包采用内容 hash,文件内容未改变情况下多次打包不会修改文件名中的 hash 值;

  • 无需手动添加页面 webpack entry,只需按照 pages 目录结构添加页面即可;

页面目录结构

|-- pages/                        -- 源文件
|   |-- index.html                  -- 主页面
|   |-- index.css
|   |-- index.js
|   |-- page-a/                     -- page-a 页面
|       |-- index.html
|       |-- index.css
|       |-- index.js
|       |-- sub-page-a                  -- page-a 子页面
|           |-- index.html
|           |-- index.css
|           |-- index.js
|   ... (more like page-a)

建议

  • 打包之后的文件目录是有讲究的,除 .html 之外的资源,全部放在 dist/assets 目录下;

    (可选)打包前将 webpack.conf/utils/constant.js assetsPublicPath 的值修改为 CDN 地址,打包后可将 dist/assets 目录直接放到 CDN。

使用

下载项目

# 安装依赖
  yarn

# 本地开发
  npm run serve

# 打包构建
  npm run build

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].