├── .babelrc ├── .codeclimate.yml ├── .editorconfig ├── .eslintignore ├── .eslintrc.yml ├── .gitignore ├── .postcssrc.js ├── .travis.yml ├── LICENSE ├── README.md ├── app ├── app.js └── views │ ├── index │ ├── bg.jpg │ ├── index.css │ ├── index.html │ └── index.js │ └── test │ ├── index.css │ ├── index.html │ └── index.js ├── internals ├── index.js └── webpack │ ├── server.js │ ├── utils.js │ ├── webpack.common.js │ ├── webpack.dev.js │ ├── webpack.dll.js │ └── webpack.prod.js ├── package-lock.json ├── package.json └── static └── lib └── polyfills.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "es2015", 5 | { 6 | "modules": false 7 | } 8 | ], 9 | "stage-0" 10 | ], 11 | "plugins": [ 12 | "lodash", 13 | "transform-runtime" 14 | ], 15 | "env": { 16 | "development": { 17 | "plugins": [] 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | engines: 2 | csslint: 3 | enabled: true 4 | duplication: 5 | enabled: false 6 | config: 7 | languages: 8 | - javascript 9 | eslint: 10 | enabled: true 11 | checks: 12 | linebreak-style: 13 | enabled: false 14 | global-require: 15 | enabled: false 16 | fixme: 17 | enabled: true 18 | ratings: 19 | paths: 20 | - app/**/* 21 | exclude_paths: 22 | - app/static/tools/**/* 23 | - app/source/font/**/* 24 | - app/source/css/library/**/* 25 | - app/source/css/parts/**/* -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | ## 项目 2 | *.pcss 3 | internals 4 | 5 | ## Node.js 6 | node_modules 7 | -------------------------------------------------------------------------------- /.eslintrc.yml: -------------------------------------------------------------------------------- 1 | env: 2 | es6: true 3 | node: true 4 | mocha: true 5 | browser: true 6 | 7 | # parser: babel-eslint # Es5 解析器 8 | 9 | extends: 10 | - airbnb 11 | #- eslint:recommended 12 | 13 | parserOptions: 14 | allowImportExportEverywhere: true 15 | ecmaVersion: 8 16 | ecmaFeatures: 17 | jsx: true 18 | globalReturn: true 19 | impliedStrict: true 20 | experimentalObjectRestSpread: true 21 | sourceType: module 22 | 23 | #plugins: 24 | # - react 25 | 26 | rules: 27 | arrow-parens: 28 | - warn 29 | - as-needed 30 | brace-style: off 31 | comma-dangle: 32 | - error 33 | - only-multiline 34 | consistent-return: off # 总返回value 35 | eol-last: off 36 | import/no-unresolved: off 37 | global-require: off 38 | 39 | # 自定义模块警告 40 | linebreak-style: off 41 | no-bitwise: off # 禁用位运算 42 | no-console: off 43 | no-plusplus: off 44 | no-underscore-dangle: off 45 | no-unused-vars: warn 46 | no-trailing-spaces: off # 禁止多余空格 47 | no-unused-expressions: off # a && b 48 | max-len: off # 禁止单行超出100字节 49 | quotes: 50 | - error 51 | - single 52 | spaced-comment: off 53 | semi: off 54 | 55 | globals: 56 | module: false 57 | window: false 58 | document: false 59 | avalon: true 60 | localStorage: true 61 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## 项目 2 | .idea/ 3 | build/ 4 | dist/ 5 | 6 | ## Node.js 7 | node_modules 8 | jspm_packages 9 | bower_components 10 | 11 | # 编辑器 12 | 13 | ## Sublime 14 | *.sublime-workspace 15 | 16 | ## Webstorm 17 | .idea/workspace.xml 18 | .idea/tasks.xml 19 | .idea/dataSources* 20 | .idea/libraries/ 21 | *.iws 22 | 23 | ## Visual Studio 24 | .vs 25 | **/[Bb]in/[Dd]ebug/ 26 | **/[Bb]in/[Rr]elease/ 27 | [Oo]bj/ 28 | *.sln.* 29 | *.vshost.* 30 | *.suo 31 | *.user 32 | _ReSharper* 33 | *.ReSharper 34 | .ntvs_analysis.dat 35 | **/[Bb]in/Microsoft.NodejsTools.WebRole.dll 36 | 37 | # 操作系统 38 | 39 | ## 临时文件 40 | *.tmp 41 | *.log 42 | *~ 43 | .cache-loader 44 | ._* 45 | 46 | ## Windows 47 | *.lnk 48 | $RECYCLE.BIN 49 | Desktop.ini 50 | ehthumbs.db 51 | Thumbs.db 52 | 53 | ## OSX 54 | .DS_Store 55 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = ctx => ({ 4 | parser: false, 5 | map: ctx.env === 'development' ? 'inline' : false, 6 | plugins: { 7 | cssnano: { 8 | safe: true // 避免 cssnano 重新计算 z-index 9 | }, 10 | 'postcss-import': {}, 11 | 'postcss-url': {}, 12 | 'postcss-cssnext': {} 13 | /*'postcss-pxtorem': { 14 | rootValue: 18, 15 | // px单位大写将忽略转化rem 16 | propList: ['!*'], 17 | selectorBlackList: [] // 忽略的选择器 18 | },*/ 19 | } 20 | }) 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '7' 4 | before_script: 5 | - export DISPLAY=:99.0 6 | - sh -e /etc/init.d/xvfb start 7 | install: 8 | - npm install 9 | - npm run installKarma 10 | - npm install coveralls 11 | script: 12 | - npm run test 13 | after_script: 14 | - npm run test:coveralls -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Wait 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # avalon-webpack-start 2 | [![Coverage Status](https://travis-ci.org/sayll/avalon-webpack-start.svg?branch=master)](https://travis-ci.org/sayll/avalon-webpack-start)  [![Coverage Status](https://coveralls.io/repos/github/sayll/avalon-webpack-start/badge.svg)](https://coveralls.io/github/sayll/avalon-webpack-start) [![Coverage Status](https://codeclimate.com/github/sayll/avalon-webpack-start/badges/gpa.svg)](https://codeclimate.com/github/sayll/avalon-webpack-start) 3 | 4 | Vue 用户请转至:[vue-start](https://github.com/sayll/vue-start) 5 | 6 | React 用户请转至:[react-webpack-start](https://github.com/sayll/react-webpack-start) 7 | 8 | 低版本IE 用户请转至:[ie-webpack-start](https://github.com/sayll/ie-webpack-start) 9 | 10 | 旧版脚手架[v2.1.0](https://github.com/sayll/avalon-webpack-start/tree/v2.1.0) 11 | 12 | ## 介绍 13 | 本版本删减了许多模块及功能,让脚手架更轻型,更易扩展,自定义。 14 | 本项目使用[`avalon2`](https://github.com/RubyLouvre/avalon)作为演示框架,演示如何进入开发。 15 | 16 | ### 关于本项目功能 17 | 1. 服务端使用Express。需要注意的是,只有一个目的那就是提供了`webpack-dev-middleware` 和 `webpack-hot-middleware`(代码热替换)。使用自定义的Express程序替换[webpack-dev-server](https://github.com/webpack/webpack-dev-server),让它更容易实现universal 渲染和为了不使这个包过于庞大。 18 | 2. 针对不同的loader采用了多线程编译,极大的加快了编译速度。 19 | 3. 使用webpack.DllReferencePlugin提取固定资源,加快编译与打包速度。 20 | 4. 启动tree-shaking 21 | 5. 启动webpack3版本:作用域提升功能 22 | 6. Babel配有transform-runtime让代码更优化。 23 | 7. 支持单页应用和多页应用的混合开发 24 | 8. 自动引入页面的CSS和JS文件。无需手动设置URL 25 | 9. 更改文件,防缓存的hash规则 26 | 10. css的模块化,默认使用postcss + postcss-cssnext,内置处理浏览器前缀。[查看更多](http://cssnext.io/) 27 | 11. 全面支持ES6的最新特性,打包转义为ES5为低版本浏览器提供支持 28 | 12. 快速编译,热更新,自动刷新 29 | 30 | ## 程序目录 31 | 32 | ``` 33 | ├── dist # 打包资源 34 | ├── internals # 项目配置文件 35 | │   ├── webpack # webpack配置文件夹 36 | │ └── index.js # 公共配置文件 37 | ├── static # 静态资源,直接绕过打包 38 | ├── app # 程序源文件 39 | └── .cache-loader            # 启动服务后的缓存文件,用于下次快速启动服务 40 | ``` 41 | 42 | ## 项目启动 43 | 44 | ### 环境配置 45 | * 为了把保证项目正常运行,请自行更新相关环境。 46 | 1. 安装[node.js](https://nodejs.org/) 47 | 2. 安装[git](https://git-scm.com/) 48 | 49 | ### 依赖配置 50 | 1. 首先clone项目 51 | ```bash 52 | $ git clone https://github.com/sayll/avalon-webpack-start.git 53 | $ cd avalon-webpack-start 54 | ``` 55 | 56 | 2. 下载依赖 57 | * 请确保你的环境配置完成,然后就可以开始以下步骤 58 | ```bash 59 | $ npm install # Install project dependencies 60 | $ npm start # Compile and launch 61 | ``` 62 | 如果一切顺利,就能正常打开端口:[http://127.0.0.1:3001/](http://127.0.0.1:3001/) 63 | 64 | ## 命令说明 65 | 66 | 开发过程中,你用得最多的会是`npm run dev`,但是这里还有很多其它的处理: 67 | 68 | |`npm run 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/views/index/index.js: -------------------------------------------------------------------------------- 1 | console.log('index.js:引入成功') 2 | 3 | avalon.define({ 4 | $id: 'app', 5 | name: 'Avalon', 6 | array: [1, 2, 3, 4] 7 | }) 8 | -------------------------------------------------------------------------------- /app/views/test/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #abcdef; 3 | } 4 | -------------------------------------------------------------------------------- /app/views/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Title 11 | 12 | 13 |
14 | 15 |

Hello,{{@name}}!

16 | 19 |
20 | 21 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/views/test/index.js: -------------------------------------------------------------------------------- 1 | console.log('index.js:引入成功') 2 | 3 | avalon.define({ 4 | $id: 'app', 5 | name: 'Avalon', 6 | array: [1, 2, 3, 4] 7 | }) 8 | -------------------------------------------------------------------------------- /internals/index.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | 3 | const filesPath = { 4 | app: 'app', // 资源根目录 5 | dist: 'dist', // 打包文件 6 | dll: 'dist/vendors', // dll打包文件 7 | utils: 'app/utils', // 资源目录 8 | static: 'static', // 静态文件目录 9 | assets: 'app/assets', // 资源目录 10 | views: 'app/views', // 视图 11 | components: 'app/components' // 组件目录 12 | } 13 | 14 | module.exports = { 15 | path: filesPath, 16 | vendors: [ 17 | 'avalon2' 18 | ], 19 | dev: { 20 | eslint: false, 21 | port: 3001, 22 | assetsPath: 'assets', 23 | assetsPublicPath: '/', 24 | sourceMap: true 25 | }, 26 | build: { 27 | eslint: false, 28 | // 服务根目录 29 | assetsRoot: path.resolve(process.cwd(), filesPath.dist), 30 | // 指向静态资源 31 | assetsPath: 'assets', 32 | assetsPublicPath: './', 33 | // 是否生成用于生产构建的源映射 34 | sourceMap: false, 35 | // Gzip 默认关闭如需开启请安装下列依赖 36 | // npm install --save-dev compression-webpack-plugin 37 | productionGzip: false, 38 | productionGzipExtensions: ['js', 'css'] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /internals/webpack/server.js: -------------------------------------------------------------------------------- 1 | const express = require('express') 2 | const webpack = require('webpack') 3 | const webpackDevMiddleware = require('webpack-dev-middleware') 4 | const webpackHotMiddleware = require('webpack-hot-middleware') 5 | const DashboardPlugin = require('webpack-dashboard/plugin') 6 | const dashboard = require('webpack-dashboard') 7 | 8 | // 配置文件 9 | const config = require('./webpack.dev.js') 10 | const utils = require('./utils') 11 | 12 | const app = express() 13 | const compiler = webpack(config) 14 | // 美化控制台 15 | compiler.apply(new DashboardPlugin(new dashboard({ 16 | port: utils.dev.port, 17 | minimal: true, 18 | title: 'Sayll', 19 | color: '#2ba1cb' 20 | }).setData)) 21 | 22 | // configuration file as a base. 23 | app.use(webpackDevMiddleware(compiler, { 24 | publicPath: config.output.publicPath, 25 | quiet: true, 26 | stats: { colors: true }, 27 | noInfo: false, 28 | hot: true 29 | })) 30 | 31 | app.use(webpackHotMiddleware(compiler, { 32 | log: (msg) => { 33 | //console.log(msg) 34 | } 35 | })) 36 | 37 | // 404 pages 38 | app.use(require('connect-history-api-fallback')()) 39 | // serve pure static assets 40 | app.use('/static', express.static(utils.resolve(utils.path.static))) 41 | app.use('/', express.static(utils.resolve(utils.path.dist))) 42 | 43 | // Serve the files on port 3000. 44 | app.listen(utils.dev.port, function () { 45 | console.log(`App listening on port ${utils.dev.port}!\n`) 46 | }) 47 | -------------------------------------------------------------------------------- /internals/webpack/utils.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const glob = require('glob') 3 | const HappyPack = require('happypack') 4 | const HtmlWebpackPlugin = require('html-webpack-plugin') 5 | 6 | const cfg = require('../index') 7 | const happyThreadPool = HappyPack.ThreadPool({ size: 6 }) // 创建5个共享线程池 8 | 9 | // 配置文件 10 | exports.dev = cfg.dev 11 | exports.build = cfg.build 12 | exports.path = cfg.path 13 | exports.vendors = cfg.vendors 14 | 15 | // 开发环境 16 | const isDev = process.env.NODE_ENV === 'development' 17 | exports.isDev = isDev 18 | exports.isServer = process.env.$Server // 服务器调试模式 19 | 20 | // 绝对路径生成器 21 | exports.resolve = (localPath, ...dir) => path.join(process.cwd(), localPath, ...dir) 22 | 23 | // 文件打包路径 24 | exports.assetsPath = _path => { 25 | const assetsSubDirectory = isDev 26 | ? cfg.build.assetsPath 27 | : cfg.dev.assetsPath 28 | return path.posix.join(assetsSubDirectory, _path) 29 | } 30 | 31 | // HappyPack生成器 32 | exports.HappyPack = (id, loaders) => new HappyPack({ 33 | id, 34 | loaders, 35 | debug: false, 36 | verbose: false, 37 | // threads: 4, 38 | threadPool: happyThreadPool // 自动分配线程池 39 | }) 40 | 41 | // --------------------------------------------多页配置 42 | 43 | // 文件分离 44 | exports.getEntries = (Path, type) => { 45 | let pathDir = Path, 46 | entry, // 文件完整路径 47 | dirName, // 传入的文件夹路径 48 | baseName, // 文件名 49 | pathName, // 文件夹路劲 50 | relativeName, // 键名所需,相对传入文件地址路径 51 | extName // 文件格式 52 | 53 | const files = glob.sync(`${Path}/${type}`) 54 | const entries = {} 55 | for (const i in files) { 56 | entry = files[i] 57 | extName = path.extname(entry) 58 | dirName = path.dirname(entry) 59 | baseName = path.basename(entry, extName) 60 | pathName = path.normalize(path.join(dirName, baseName)) 61 | pathDir = path.normalize(pathDir) 62 | 63 | // 逻辑部分 64 | relativeName = path.relative(pathDir, dirName) 65 | pathName = path.basename(pathName) 66 | if (relativeName.includes('\\') || relativeName.includes('\/')) { 67 | continue 68 | } 69 | else { 70 | if (extName === '.html') { 71 | entries[relativeName] = entry 72 | } 73 | else if (pathName === 'index') { 74 | entries[relativeName] = [entry] 75 | } 76 | } 77 | } 78 | return entries 79 | } 80 | 81 | // 创建多页 82 | exports.createPages = (plugins, pages) => { 83 | Object.keys(pages).map(key => { 84 | // 配置生成的html文件,定义路径等 85 | const conf = { 86 | filename: key + '.html', 87 | template: pages[key], 88 | inject: true, 89 | } 90 | if (!isDev) { 91 | conf.minify = { 92 | removeComments: true, 93 | collapseWhitespace: true, 94 | removeRedundantAttributes: true, 95 | useShortDoctype: true, 96 | removeEmptyAttributes: true, 97 | removeStyleLinkTypeAttributes: true, 98 | keepClosingSlash: true, 99 | minifyJS: true, 100 | minifyCSS: true, 101 | minifyURLs: true 102 | } 103 | } 104 | plugins.push(new HtmlWebpackPlugin(conf)) 105 | }) 106 | } 107 | -------------------------------------------------------------------------------- /internals/webpack/webpack.common.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack') 2 | const Merge = require('webpack-merge') 3 | 4 | const utils = require('./utils') 5 | 6 | module.exports = { 7 | target: 'web', 8 | 9 | stats: 'errors-only', // 只在发生错误 或是 新的编译时输出 10 | 11 | entry: Merge( 12 | utils.getEntries(utils.resolve(utils.path.views), `**/*.js`), 13 | utils.getEntries(utils.resolve(utils.path.views), `**/*.css`), { 14 | main: [utils.resolve(utils.path.app, `app.js`)] 15 | }), 16 | 17 | output: { 18 | filename: utils.isDev ? '[name].js' : `${utils.build.assetsPath}/[name].[chunkhash:8].js`, 19 | chunkFilename: utils.isDev ? 20 | '[name].js' : '[name].[chunkhash:8].js', 21 | path: utils.resolve(utils.path.dist), // emit 22 | publicPath: utils.isServer ? 23 | utils.dev.assetsPublicPath : utils.build.assetsPublicPath 24 | }, 25 | 26 | resolve: { 27 | alias: { // 索引某些依赖 28 | '~': utils.resolve(utils.path.app) 29 | }, 30 | extensions: ['.js', '.jsx'] 31 | // modules: ['node_modules'] 32 | }, 33 | 34 | plugins: [ 35 | new webpack.ProvidePlugin({ // 其他模块可以公用 36 | 'avalon': 'avalon2' 37 | }), 38 | new webpack.DefinePlugin({ // 配置环境 39 | 'NICE_FEATURE': JSON.stringify(utils.isDev), // 「启用/禁用」「生产/开发」构建中的功能。 40 | 'EXPERIMENTAL_FEATURE': JSON.stringify(utils.isDev), // 实验性功能 41 | 'process.env': { 42 | NODE_ENV: JSON.stringify(process.env.NODE_ENV) 43 | } 44 | }), 45 | new webpack.optimize.OccurrenceOrderPlugin(), // 排序输出 46 | new webpack.optimize.ModuleConcatenationPlugin(), // 提升作用域 47 | // HappyPack 48 | utils.HappyPack('Babel', ['cache-loader', 'babel-loader']) 49 | ], 50 | 51 | module: { 52 | noParse: [/jquery$/], // 不解析某些模块 53 | rules: [ 54 | { 55 | test: /\.(js|jsx)$/, 56 | use: ['happypack/loader?id=Babel'], 57 | include: [utils.resolve(utils.path.app)], 58 | exclude: file => !!file.match(/node_modules/) 59 | }, 60 | { 61 | test: /\.(css|pcss)$/, 62 | include: /node_modules/, 63 | use: [ 64 | 'style-loader', 65 | 'css-loader' 66 | ] 67 | }, 68 | { 69 | test: /\.(png|svg|jpe?g|gif)$/, 70 | include: [utils.resolve(utils.path.app)], 71 | use: [{ 72 | loader: 'url-loader', 73 | options: { 74 | limit: 4096, 75 | name: utils.assetsPath('images/[name].[hash:8].[ext]') 76 | } 77 | }] 78 | }, 79 | { 80 | test: /\.(woff|woff2|eot|ttf|otf)$/, 81 | include: [utils.resolve(utils.path.app)], 82 | use: { 83 | loader: 'file-loader', 84 | options: { 85 | name: utils.assetsPath('fonts/[name].[hash:8].[ext]') 86 | } 87 | } 88 | } 89 | ] 90 | } 91 | } 92 | 93 | // 添加Eslint 94 | if (utils.isDev ? utils.dev.eslint : utils.build.eslint) { 95 | module.exports.plugins.unshift(utils.HappyPack('ESLint', ['cache-loader', 'eslint-loader'])) 96 | module.exports.module.rules.unshift({ 97 | test: /\.(js|jsx)$/, 98 | use: ['happypack/loader?id=ESLint'], 99 | include: [utils.resolve(utils.path.app)], 100 | exclude: file => !!file.match(/node_modules/), 101 | enforce: 'pre' 102 | }) 103 | } 104 | 105 | // 添加多页 106 | const pages = utils.getEntries(utils.resolve(utils.path.views), '**/*.html') 107 | 108 | utils.createPages(module.exports.plugins, pages) 109 | -------------------------------------------------------------------------------- /internals/webpack/webpack.dev.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack') 2 | const webpackMerge = require('webpack-merge') 3 | const IncludeAssetsPlugin = require('html-webpack-include-assets-plugin') 4 | 5 | const utils = require('./utils') 6 | const common = require('./webpack.common') 7 | 8 | Object.keys(common.entry).forEach(name => { 9 | common.entry[name].unshift( 10 | 'webpack-hot-middleware/client?noInfo=true&reload=true' 11 | //'eventsource-polyfill' // 热替换兼容低版IE 12 | ) 13 | }) 14 | 15 | module.exports = webpackMerge(common, { 16 | devtool: 'cheap-module-eval-source-map', 17 | plugins: [ 18 | // 热更新 19 | new webpack.HotModuleReplacementPlugin() 20 | ], 21 | module: { 22 | rules: [ 23 | { 24 | test: /\.css|pcss$/, 25 | include: [utils.resolve(utils.path.app)], 26 | use: [ 27 | 'style-loader', 28 | 'css-loader', 29 | 'postcss-loader' 30 | ] 31 | } 32 | ] 33 | } 34 | }) 35 | 36 | utils.vendors.length && ( 37 | module.exports.plugins.push( 38 | new IncludeAssetsPlugin({ 39 | assets: [`${utils.path.dll.replace(`${utils.path.dist}/`, '')}/vendors.js`], 40 | append: false, 41 | hash: true 42 | }), 43 | new webpack.DllReferencePlugin({ 44 | context: '/', 45 | manifest: require(utils.resolve(utils.path.dll, `vendors.json`)) 46 | }) 47 | ) 48 | ) 49 | -------------------------------------------------------------------------------- /internals/webpack/webpack.dll.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack') 2 | 3 | const utils = require('./utils') 4 | 5 | // 没有依赖,跳出执行 6 | !utils.vendors.length && process.exit(0) 7 | 8 | module.exports = { 9 | devtool: 'eval', 10 | entry: { 11 | vendors: utils.vendors 12 | }, 13 | output: { 14 | path: utils.resolve(utils.path.dll), 15 | filename: '[name].js', 16 | library: '[name]' 17 | }, 18 | plugins: [ 19 | new webpack.DllPlugin({ 20 | path: utils.resolve(utils.path.dll, 'vendors.json'), 21 | name: '[name]', 22 | context: '/' 23 | }), 24 | new webpack.DefinePlugin({ 25 | 'NICE_FEATURE': JSON.stringify(!utils.isDev), 26 | 'process.env': { 27 | NODE_ENV: JSON.stringify(process.env.NODE_ENV) 28 | } 29 | }), 30 | new webpack.optimize.ModuleConcatenationPlugin() // 提升作用域 31 | ], 32 | performance: { 33 | hints: false 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /internals/webpack/webpack.prod.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack') 2 | const webpackMerge = require('webpack-merge') 3 | const CleanPlugin = require('clean-webpack-plugin') 4 | const CopyPlugin = require('copy-webpack-plugin') 5 | const UglifyJSPlugin = require('uglifyjs-webpack-plugin') 6 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 7 | 8 | const utils = require('./utils') 9 | const common = require('./webpack.common') 10 | 11 | // 导出配置 12 | module.exports = webpackMerge(common, { 13 | entry: Object.assign({}, utils.vendors.length && { 14 | vendors: utils.vendors 15 | }), 16 | devtool: utils.isDev ? 'cheap-module-eval-source-map' : 'cheap-module-source-map', 17 | plugins: [ 18 | // 清除构建前文件 19 | new CleanPlugin([utils.path.dist], { 20 | root: utils.resolve('./'), 21 | exclude: [utils.isDev && 'vendors'], // 测试模式保留vendors文件 22 | verbose: true, 23 | dry: false 24 | }), 25 | // 复制静态地址文件 26 | new CopyPlugin([ 27 | { 28 | from: utils.resolve(utils.path.static), 29 | to: utils.path.static, 30 | ignore: ['.*'] 31 | } 32 | ]), 33 | new ExtractTextPlugin({ 34 | filename: utils.assetsPath('../[name].[contenthash].css') 35 | }), 36 | new webpack.HashedModuleIdsPlugin({ // 修复文件修改后的模块索引id使hash缓存失效 37 | hashFunction: 'md5', 38 | hashDigest: 'base64', 39 | hashDigestLength: 4 40 | }), 41 | new webpack.optimize.LimitChunkCountPlugin({ 42 | maxChunks: 10, // 限制 chunk 的最大数量 -- 必须大于或等于 1 43 | minChunkSize: 1000 44 | }), 45 | new webpack.optimize.CommonsChunkPlugin({ // 抽离公共项 必须在runtime前引入 46 | name: 'vendors', 47 | minChunks: Infinity 48 | }), 49 | new webpack.optimize.CommonsChunkPlugin({ // 抽离运行时代码 50 | name: 'runtime',// 其他模块重复使用 51 | minChunks: 2 52 | }) 53 | ], 54 | module: { 55 | rules: [ 56 | { 57 | test: /\.(css|pcss)$/, 58 | include: [utils.resolve(utils.path.app)], 59 | use: ExtractTextPlugin.extract({ 60 | fallback: 'style-loader', 61 | use: [ 62 | 'css-loader', 63 | 'postcss-loader' 64 | ] 65 | }) 66 | } 67 | ] 68 | }, 69 | 70 | performance: { // 性能警告 71 | maxAssetSize: 250000, // 单资源最大 72 | hints: 'warning' 73 | } 74 | }) 75 | 76 | // 压缩代码 77 | !utils.isDev && module.exports.plugins.push(new UglifyJSPlugin({ 78 | parallel: { 79 | cache: true, 80 | workers: 2 // for e.g 81 | } 82 | })) 83 | 84 | // Gzip 85 | if (utils.build.productionGzip) { 86 | const CompressionPlugin = require('compression-webpack-plugin') 87 | module.exports.plugins.push( 88 | new CompressionPlugin({ 89 | asset: '[path].gz[query]', 90 | algorithm: 'gzip', 91 | test: new RegExp( 92 | '\\.(' + 93 | utils.build.productionGzipExtensions.join('|') + 94 | ')$' 95 | ), 96 | threshold: 10240, 97 | minRatio: 0.8 98 | }) 99 | ) 100 | } 101 | 102 | // 资源分析仪 103 | if (process.env.$Analyzer) { 104 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 105 | module.exports.plugins.push(new BundleAnalyzerPlugin()) 106 | } 107 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "avalon-webpack-start", 3 | "main": "mian.js", 4 | "scripts": { 5 | "start": "bnr dll && bnr dev", 6 | "dev": "bnr dev", 7 | "dll": "bnr dll", 8 | "build": "bnr build", 9 | "bundle": "bnr build:bundle", 10 | "deploy": "bnr deploy" 11 | }, 12 | "betterScripts": { 13 | "dev": { 14 | "command": "node ./internals/webpack/server.js", 15 | "env": { 16 | "$Server": "true", 17 | "NODE_ENV": "development" 18 | } 19 | }, 20 | "dll": { 21 | "command": "webpack --progress --config ./internals/webpack/webpack.dll.js", 22 | "env": { 23 | "NODE_ENV": "production" 24 | } 25 | }, 26 | "build": { 27 | "command": "webpack --progress --config ./internals/webpack/webpack.prod.js", 28 | "env": { 29 | "NODE_ENV": "development" 30 | } 31 | }, 32 | "build:bundle": { 33 | "command": "webpack --progress --config ./internals/webpack/webpack.prod.js", 34 | "env": { 35 | "NODE_ENV": "production", 36 | "$Analyzer": "true" 37 | } 38 | }, 39 | "deploy": { 40 | "command": "webpack --progress --config ./internals/webpack/webpack.prod.js", 41 | "env": { 42 | "NODE_ENV": "production" 43 | } 44 | } 45 | }, 46 | "license": "MIT", 47 | "devDependencies": { 48 | "babel-core": "^6.26.0", 49 | "babel-loader": "^7.1.2", 50 | "babel-plugin-lodash": "^3.2.11", 51 | "babel-plugin-transform-runtime": "^6.23.0", 52 | "babel-preset-es2015": "^6.24.1", 53 | "babel-preset-stage-0": "^6.24.1", 54 | "better-npm-run": "^0.1.0", 55 | "bundle-loader": "^0.5.5", 56 | "cache-loader": "^1.0.3", 57 | "clean-webpack-plugin": "^0.1.16", 58 | "connect-history-api-fallback": "^1.3.0", 59 | "copy-webpack-plugin": "^4.0.1", 60 | "css-loader": "^0.28.7", 61 | "cssnano": "^3.10.0", 62 | "eslint": "^4.5.0", 63 | "eslint-config-airbnb": "^15.1.0", 64 | "eslint-friendly-formatter": "^3.0.0", 65 | "eslint-loader": "^1.9.0", 66 | "eslint-plugin-import": "^2.7.0", 67 | "eslint-plugin-jsx-a11y": "^5.1.1", 68 | "eslint-plugin-react": "^7.3.0", 69 | "express": "^4.15.4", 70 | "extract-text-webpack-plugin": "^3.0.0", 71 | "file-loader": "^0.11.2", 72 | "glob": "^7.1.2", 73 | "happypack": "^4.0.0", 74 | "html-webpack-include-assets-plugin": "^0.0.7", 75 | "html-webpack-plugin": "^2.30.1", 76 | "postcss-cssnext": "^3.0.2", 77 | "postcss-import": "^10.0.0", 78 | "postcss-loader": "^2.0.6", 79 | "postcss-modules": "^0.8.0", 80 | "postcss-url": "^7.1.2", 81 | "style-loader": "^0.18.2", 82 | "uglifyjs-webpack-plugin": "^0.4.6", 83 | "url-loader": "^0.5.9", 84 | "webpack": "^3.5.6", 85 | "webpack-bundle-analyzer": "^2.9.0", 86 | "webpack-dashboard": "^0.4.0", 87 | "webpack-dev-middleware": "^1.12.0", 88 | "webpack-hot-middleware": "^2.19.1", 89 | "webpack-merge": "^4.1.0" 90 | }, 91 | "dependencies": { 92 | "avalon2": "^2.2.9" 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /static/lib/polyfills.js: -------------------------------------------------------------------------------- 1 | !function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!u&&c)return c(o,!0);if(i)return i(o,!0);var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(n){var r=t[o][1][n];return s(r||n)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o2?arguments[2]:void 0,s=Math.min((void 0===f?u:i(f,u))-a,u-c),l=1;for(a0;)a in r?r[c]=r[a]:delete r[c],c+=l,a+=l;return r}},{114:114,118:118,119:119}],9:[function(t,n,r){"use strict";var e=t(119),i=t(114),o=t(118);n.exports=function fill(t){for(var n=e(this),r=o(n.length),u=arguments.length,c=i(u>1?arguments[1]:void 0,r),a=u>2?arguments[2]:void 0,f=void 0===a?r:i(a,r);f>c;)n[c++]=t;return n}},{114:114,118:118,119:119}],10:[function(t,n,r){var e=t(39);n.exports=function(t,n){var r=[];return e(t,!1,r.push,r,n),r}},{39:39}],11:[function(t,n,r){var e=t(117),i=t(118),o=t(114);n.exports=function(t){return function(n,r,u){var c,a=e(n),f=i(a.length),s=o(u,f);if(t&&r!=r){for(;f>s;)if((c=a[s++])!=c)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}}},{114:114,117:117,118:118}],12:[function(t,n,r){var e=t(25),i=t(47),o=t(119),u=t(118),c=t(15);n.exports=function(t,n){var r=1==t,a=2==t,f=3==t,s=4==t,l=6==t,h=5==t||l,v=n||c;return function(n,c,p){for(var d,y,g=o(n),m=i(g),b=e(c,p,3),x=u(m.length),S=0,w=r?v(n,x):a?v(n,0):void 0;x>S;S++)if((h||S in m)&&(d=m[S],y=b(d,S,g),t))if(r)w[S]=y;else if(y)switch(t){case 3:return!0;case 5:return d;case 6:return S;case 2:w.push(d)}else if(s)return!1;return l?-1:f||s?s:w}}},{118:118,119:119,15:15,25:25,47:47}],13:[function(t,n,r){var e=t(3),i=t(119),o=t(47),u=t(118);n.exports=function(t,n,r,c,a){e(n);var f=i(t),s=o(f),l=u(f.length),h=a?l-1:0,v=a?-1:1;if(r<2)for(;;){if(h in s){c=s[h],h+=v;break}if(h+=v,a?h<0:l<=h)throw TypeError("Reduce of empty array with no initial value")}for(;a?h>=0:l>h;h+=v)h in s&&(c=n(c,s[h],h,f));return c}},{118:118,119:119,3:3,47:47}],14:[function(t,n,r){var e=t(51),i=t(49),o=t(128)("species");n.exports=function(t){var n;return i(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)||(n=void 0),e(n)&&null===(n=n[o])&&(n=void 0)),void 0===n?Array:n}},{128:128,49:49,51:51}],15:[function(t,n,r){var e=t(14);n.exports=function(t,n){return new(e(t))(n)}},{14:14}],16:[function(t,n,r){"use strict";var e=t(3),i=t(51),o=t(46),u=[].slice,c={},a=function(t,n,r){if(!(n in c)){for(var e=[],i=0;i1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(e(r.v,r.k,this);r&&r.r;)r=r.p},has:function has(t){return!!y(p(this,n),t)}}),h&&e(s.prototype,"size",{get:function(){return p(this,n)[d]}}),s},def:function(t,n,r){var e,i,o=y(t,n);return o?o.v=r:(t._l=o={i:i=v(n,!0),k:n,v:r,p:e=t._l,n:void 0,r:!1},t._f||(t._f=o),e&&(e.n=o),t[d]++,"F"!==i&&(t._i[i]=o)),t},getEntry:y,setStrong:function(t,n,r){f(t,n,function(t,r){this._t=p(t,n),this._k=r,this._l=void 0},function(){for(var t=this,n=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==n?s(0,r.k):"values"==n?s(0,r.v):s(0,[r.k,r.v]):(t._t=void 0,s(1))},r?"entries":"values",!r,!0),l(n)}}},{100:100,125:125,25:25,29:29,39:39,55:55,57:57,6:6,66:66,71:71,72:72,93:93}],20:[function(t,n,r){var e=t(17),i=t(10);n.exports=function(t){return function toJSON(){if(e(this)!=t)throw TypeError(t+"#toJSON isn't generic");return i(this)}}},{10:10,17:17}],21:[function(t,n,r){"use strict";var e=t(93),i=t(66).getWeak,o=t(7),u=t(51),c=t(6),a=t(39),f=t(12),s=t(41),l=t(125),h=f(5),v=f(6),p=0,d=function(t){return t._l||(t._l=new y)},y=function(){this.a=[]},g=function(t,n){return h(t.a,function(t){return t[0]===n})};y.prototype={get:function(t){var n=g(this,t);if(n)return n[1]},has:function(t){return!!g(this,t)},set:function(t,n){var r=g(this,t);r?r[1]=n:this.a.push([t,n])},delete:function(t){var n=v(this.a,function(n){return n[0]===t});return~n&&this.a.splice(n,1),!!~n}},n.exports={getConstructor:function(t,n,r,o){var f=t(function(t,e){c(t,f,n,"_i"),t._t=n,t._i=p++,t._l=void 0,void 0!=e&&a(e,r,t[o],t)});return e(f.prototype,{delete:function(t){if(!u(t))return!1;var r=i(t);return!0===r?d(l(this,n)).delete(t):r&&s(r,this._i)&&delete r[this._i]},has:function has(t){if(!u(t))return!1;var r=i(t);return!0===r?d(l(this,n)).has(t):r&&s(r,this._i)}}),f},def:function(t,n,r){var e=i(o(n),!0);return!0===e?d(t).set(n,r):e[t._i]=r,t},ufstore:d}},{12:12,125:125,39:39,41:41,51:51,6:6,66:66,7:7,93:93}],22:[function(t,n,r){"use strict";var e=t(40),i=t(33),o=t(94),u=t(93),c=t(66),a=t(39),f=t(6),s=t(51),l=t(35),h=t(56),v=t(101),p=t(45);n.exports=function(t,n,r,d,y,g){var m=e[t],b=m,x=y?"set":"add",S=b&&b.prototype,w={},_=function(t){var n=S[t];o(S,t,"delete"==t?function(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"has"==t?function has(t){return!(g&&!s(t))&&n.call(this,0===t?0:t)}:"get"==t?function get(t){return g&&!s(t)?void 0:n.call(this,0===t?0:t)}:"add"==t?function add(t){return n.call(this,0===t?0:t),this}:function set(t,r){return n.call(this,0===t?0:t,r),this})};if("function"==typeof b&&(g||S.forEach&&!l(function(){(new b).entries().next()}))){var E=new b,O=E[x](g?{}:-0,1)!=E,P=l(function(){E.has(1)}),M=h(function(t){new b(t)}),F=!g&&l(function(){for(var t=new b,n=5;n--;)t[x](n,n);return!t.has(-0)});M||(b=n(function(n,r){f(n,b,t);var e=p(new m,n,b);return void 0!=r&&a(r,y,e[x],e),e}),b.prototype=S,S.constructor=b),(P||F)&&(_("delete"),_("has"),y&&_("get")),(F||O)&&_(x),g&&S.clear&&delete S.clear}else b=d.getConstructor(n,t,y,x),u(b.prototype,r),c.NEED=!0;return v(b,t),w[t]=b,i(i.G+i.W+i.F*(b!=m),w),g||d.setStrong(b,t,y),b}},{101:101,33:33,35:35,39:39,40:40,45:45,51:51,56:56,6:6,66:66,93:93,94:94}],23:[function(t,n,r){var e=n.exports={version:"2.5.0"};"number"==typeof __e&&(__e=e)},{}],24:[function(t,n,r){"use strict";var e=t(72),i=t(92);n.exports=function(t,n,r){n in t?e.f(t,n,i(0,r)):t[n]=r}},{72:72,92:92}],25:[function(t,n,r){var e=t(3);n.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,i){return t.call(n,r,e,i)}}return function(){return t.apply(n,arguments)}}},{3:3}],26:[function(t,n,r){"use strict";var e=t(35),i=Date.prototype.getTime,o=Date.prototype.toISOString,u=function(t){return t>9?t:"0"+t};n.exports=e(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!e(function(){o.call(new Date(NaN))})?function toISOString(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),r=t.getUTCMilliseconds(),e=n<0?"-":n>9999?"+":"";return e+("00000"+Math.abs(n)).slice(e?-6:-4)+"-"+u(t.getUTCMonth()+1)+"-"+u(t.getUTCDate())+"T"+u(t.getUTCHours())+":"+u(t.getUTCMinutes())+":"+u(t.getUTCSeconds())+"."+(r>99?r:"0"+u(r))+"Z"}:o},{35:35}],27:[function(t,n,r){"use strict";var e=t(7),i=t(120);n.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return i(e(this),"number"!=t)}},{120:120,7:7}],28:[function(t,n,r){n.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},{}],29:[function(t,n,r){n.exports=!t(35)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{35:35}],30:[function(t,n,r){var e=t(51),i=t(40).document,o=e(i)&&e(i.createElement);n.exports=function(t){return o?i.createElement(t):{}}},{40:40,51:51}],31:[function(t,n,r){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],32:[function(t,n,r){var e=t(81),i=t(78),o=t(82);n.exports=function(t){var n=e(t),r=i.f;if(r)for(var u,c=r(t),a=o.f,f=0;c.length>f;)a.call(t,u=c[f++])&&n.push(u);return n}},{78:78,81:81,82:82}],33:[function(t,n,r){var e=t(40),i=t(23),o=t(42),u=t(94),c=t(25),a=function(t,n,r){var f,s,l,h,v=t&a.F,p=t&a.G,d=t&a.S,y=t&a.P,g=t&a.B,m=p?e:d?e[n]||(e[n]={}):(e[n]||{}).prototype,b=p?i:i[n]||(i[n]={}),x=b.prototype||(b.prototype={});p&&(r=n);for(f in r)s=!v&&m&&void 0!==m[f],l=(s?m:r)[f],h=g&&s?c(l,e):y&&"function"==typeof l?c(Function.call,l):l,m&&u(m,f,l,t&a.U),b[f]!=l&&o(b,f,h),y&&x[f]!=l&&(x[f]=l)};e.core=i,a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,n.exports=a},{23:23,25:25,40:40,42:42,94:94}],34:[function(t,n,r){var e=t(128)("match");n.exports=function(t){var n=/./;try{"/./"[t](n)}catch(r){try{return n[e]=!1,!"/./"[t](n)}catch(t){}}return!0}},{128:128}],35:[function(t,n,r){n.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],36:[function(t,n,r){"use strict";var e=t(42),i=t(94),o=t(35),u=t(28),c=t(128);n.exports=function(t,n,r){var a=c(t),f=r(u,a,""[t]),s=f[0],l=f[1];o(function(){var n={};return n[a]=function(){return 7},7!=""[t](n)})&&(i(String.prototype,t,s),e(RegExp.prototype,a,2==n?function(t,n){return l.call(t,this,n)}:function(t){return l.call(t,this)}))}},{128:128,28:28,35:35,42:42,94:94}],37:[function(t,n,r){"use strict";var e=t(7);n.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},{7:7}],38:[function(t,n,r){"use strict";function flattenIntoArray(t,n,r,a,f,s,l,h){for(var v,p,d=f,y=0,g=!!l&&u(l,h,3);y0)d=flattenIntoArray(t,n,v,o(v.length),d,s-1)-1;else{if(d>=9007199254740991)throw TypeError();t[d]=v}d++}y++}return d}var e=t(49),i=t(51),o=t(118),u=t(25),c=t(128)("isConcatSpreadable");n.exports=flattenIntoArray},{118:118,128:128,25:25,49:49,51:51}],39:[function(t,n,r){var e=t(25),i=t(53),o=t(48),u=t(7),c=t(118),a=t(129),f={},s={},r=n.exports=function(t,n,r,l,h){var v,p,d,y,g=h?function(){return t}:a(t),m=e(r,l,n?2:1),b=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(o(g)){for(v=c(t.length);v>b;b++)if((y=n?m(u(p=t[b])[0],p[1]):m(t[b]))===f||y===s)return y}else for(d=g.call(t);!(p=d.next()).done;)if((y=i(d,m,p.value,n))===f||y===s)return y};r.BREAK=f,r.RETURN=s},{118:118,129:129,25:25,48:48,53:53,7:7}],40:[function(t,n,r){var e=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},{}],41:[function(t,n,r){var e={}.hasOwnProperty;n.exports=function(t,n){return e.call(t,n)}},{}],42:[function(t,n,r){var e=t(72),i=t(92);n.exports=t(29)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},{29:29,72:72,92:92}],43:[function(t,n,r){var e=t(40).document;n.exports=e&&e.documentElement},{40:40}],44:[function(t,n,r){n.exports=!t(29)&&!t(35)(function(){return 7!=Object.defineProperty(t(30)("div"),"a",{get:function(){return 7}}).a})},{29:29,30:30,35:35}],45:[function(t,n,r){var e=t(51),i=t(99).set;n.exports=function(t,n,r){var o,u=n.constructor;return u!==r&&"function"==typeof u&&(o=u.prototype)!==r.prototype&&e(o)&&i&&i(t,o),t}},{51:51,99:99}],46:[function(t,n,r){n.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},{}],47:[function(t,n,r){var e=t(18);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},{18:18}],48:[function(t,n,r){var e=t(58),i=t(128)("iterator"),o=Array.prototype;n.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},{128:128,58:58}],49:[function(t,n,r){var e=t(18);n.exports=Array.isArray||function isArray(t){return"Array"==e(t)}},{18:18}],50:[function(t,n,r){var e=t(51),i=Math.floor;n.exports=function isInteger(t){return!e(t)&&isFinite(t)&&i(t)===t}},{51:51}],51:[function(t,n,r){n.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],52:[function(t,n,r){var e=t(51),i=t(18),o=t(128)("match");n.exports=function(t){var n;return e(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},{128:128,18:18,51:51}],53:[function(t,n,r){var e=t(7);n.exports=function(t,n,r,i){try{return i?n(e(r)[0],r[1]):n(r)}catch(n){var o=t.return;throw void 0!==o&&e(o.call(t)),n}}},{7:7}],54:[function(t,n,r){"use strict";var e=t(71),i=t(92),o=t(101),u={};t(42)(u,t(128)("iterator"),function(){return this}),n.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},{101:101,128:128,42:42,71:71,92:92}],55:[function(t,n,r){"use strict";var e=t(60),i=t(33),o=t(94),u=t(42),c=t(41),a=t(58),f=t(54),s=t(101),l=t(79),h=t(128)("iterator"),v=!([].keys&&"next"in[].keys()),p=function(){return this};n.exports=function(t,n,r,d,y,g,m){f(r,n,d);var b,x,S,w=function(t){if(!v&&t in P)return P[t];switch(t){case"keys":return function keys(){return new r(this,t)};case"values":return function values(){return new r(this,t)}}return function entries(){return new r(this,t)}},_=n+" Iterator",E="values"==y,O=!1,P=t.prototype,M=P[h]||P["@@iterator"]||y&&P[y],F=M||w(y),I=y?E?w("entries"):F:void 0,A="Array"==n?P.entries||M:M;if(A&&(S=l(A.call(new t)))!==Object.prototype&&S.next&&(s(S,_,!0),e||c(S,h)||u(S,h,p)),E&&M&&"values"!==M.name&&(O=!0,F=function values(){return M.call(this)}),e&&!m||!v&&!O&&P[h]||u(P,h,F),a[n]=F,a[_]=p,y)if(b={values:E?F:w("values"),keys:g?F:w("keys"),entries:I},m)for(x in b)x in P||o(P,x,b[x]);else i(i.P+i.F*(v||O),n,b);return b}},{101:101,128:128,33:33,41:41,42:42,54:54,58:58,60:60,79:79,94:94}],56:[function(t,n,r){var e=t(128)("iterator"),i=!1;try{var o=[7][e]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}n.exports=function(t,n){if(!n&&!i)return!1;var r=!1;try{var o=[7],u=o[e]();u.next=function(){return{done:r=!0}},o[e]=function(){return u},t(o)}catch(t){}return r}},{128:128}],57:[function(t,n,r){n.exports=function(t,n){return{value:n,done:!!t}}},{}],58:[function(t,n,r){n.exports={}},{}],59:[function(t,n,r){var e=t(81),i=t(117);n.exports=function(t,n){for(var r,o=i(t),u=e(o),c=u.length,a=0;c>a;)if(o[r=u[a++]]===n)return r}},{117:117,81:81}],60:[function(t,n,r){n.exports=!1},{}],61:[function(t,n,r){var e=Math.expm1;n.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!=e(-2e-17)?function expm1(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:e},{}],62:[function(t,n,r){var e=t(65),i=Math.pow,o=i(2,-52),u=i(2,-23),c=i(2,127)*(2-u),a=i(2,-126),f=function(t){return t+1/o-1/o};n.exports=Math.fround||function fround(t){var n,r,i=Math.abs(t),s=e(t);return ic||r!=r?s*(1/0):s*r)}},{65:65}],63:[function(t,n,r){n.exports=Math.log1p||function log1p(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},{}],64:[function(t,n,r){n.exports=Math.scale||function scale(t,n,r,e,i){return 0===arguments.length||t!=t||n!=n||r!=r||e!=e||i!=i?NaN:t===1/0||t===-1/0?t:(t-n)*(i-e)/(r-n)+e}},{}],65:[function(t,n,r){n.exports=Math.sign||function sign(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},{}],66:[function(t,n,r){var e=t(124)("meta"),i=t(51),o=t(41),u=t(72).f,c=0,a=Object.isExtensible||function(){return!0},f=!t(35)(function(){return a(Object.preventExtensions({}))}),s=function(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})},l=function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!a(t))return"F";if(!n)return"E";s(t)}return t[e].i},h=function(t,n){if(!o(t,e)){if(!a(t))return!0;if(!n)return!1;s(t)}return t[e].w},v=function(t){return f&&p.NEED&&a(t)&&!o(t,e)&&s(t),t},p=n.exports={KEY:e,NEED:!1,fastKey:l,getWeak:h,onFreeze:v}},{124:124,35:35,41:41,51:51,72:72}],67:[function(t,n,r){var e=t(160),i=t(33),o=t(103)("metadata"),u=o.store||(o.store=new(t(266))),c=function(t,n,r){var i=u.get(t);if(!i){if(!r)return;u.set(t,i=new e)}var o=i.get(n);if(!o){if(!r)return;i.set(n,o=new e)}return o},a=function(t,n,r){var e=c(n,r,!1);return void 0!==e&&e.has(t)},f=function(t,n,r){var e=c(n,r,!1);return void 0===e?void 0:e.get(t)},s=function(t,n,r,e){c(r,e,!0).set(t,n)},l=function(t,n){var r=c(t,n,!1),e=[];return r&&r.forEach(function(t,n){e.push(n)}),e},h=function(t){return void 0===t||"symbol"==typeof t?t:String(t)},v=function(t){i(i.S,"Reflect",t)};n.exports={store:u,map:c,has:a,get:f,set:s,keys:l,key:h,exp:v}},{103:103,160:160,266:266,33:33}],68:[function(t,n,r){var e=t(40),i=t(113).set,o=e.MutationObserver||e.WebKitMutationObserver,u=e.process,c=e.Promise,a="process"==t(18)(u);n.exports=function(){var t,n,r,f=function(){var e,i;for(a&&(e=u.domain)&&e.exit();t;){i=t.fn,t=t.next;try{i()}catch(e){throw t?r():n=void 0,e}}n=void 0,e&&e.enter()};if(a)r=function(){u.nextTick(f)};else if(o){var s=!0,l=document.createTextNode("");new o(f).observe(l,{characterData:!0}),r=function(){l.data=s=!s}}else if(c&&c.resolve){var h=c.resolve();r=function(){h.then(f)}}else r=function(){i.call(e,f)};return function(e){var i={fn:e,next:void 0};n&&(n.next=i),t||(t=i,r()),n=i}}},{113:113,18:18,40:40}],69:[function(t,n,r){"use strict";function PromiseCapability(t){var n,r;this.promise=new t(function(t,e){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=t,r=e}),this.resolve=e(n),this.reject=e(r)}var e=t(3);n.exports.f=function(t){return new PromiseCapability(t)}},{3:3}],70:[function(t,n,r){"use strict";var e=t(81),i=t(78),o=t(82),u=t(119),c=t(47),a=Object.assign;n.exports=!a||t(35)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=a({},t)[r]||Object.keys(a({},n)).join("")!=e})?function assign(t,n){for(var r=u(t),a=arguments.length,f=1,s=i.f,l=o.f;a>f;)for(var h,v=c(arguments[f++]),p=s?e(v).concat(s(v)):e(v),d=p.length,y=0;d>y;)l.call(v,h=p[y++])&&(r[h]=v[h]);return r}:a},{119:119,35:35,47:47,78:78,81:81,82:82}],71:[function(t,n,r){var e=t(7),i=t(73),o=t(31),u=t(102)("IE_PROTO"),c=function(){},a=function(){var n,r=t(30)("iframe"),e=o.length;for(r.style.display="none",t(43).appendChild(r),r.src="javascript:",n=r.contentWindow.document,n.open(),n.write("