We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
技术栈: webpack4、babel7、vue2
npm install babel-loader @babel/core @babel/preset-env -D
module: { // 其它选项... rules: [ // 其它选项... { test: /\.js$/, include: /src/, use: { loader: 'babel-loader' } } ] }
"babel": { "presets": [ [ "@babel/preset-env", { "targets": { "browsers": [ "> 1%", "last 2 versions" ] } } ] ] }
npm install core-js@2 @babel/runtime-corejs2 -S
module.exports = function(api) { api.cache(true) return { presets: [ [ '@babel/preset-env', { useBuiltIns: 'usage', corejs: 2, targets: { browsers: ['> 1%', 'last 2 versions'] } } ] ] } }
npm install -D style-loader css-loader
module: { rules: [ // 其它选项... { test: /\.css$/, include: [/src/], use: [{ loader: 'style-loader' }, { loader: 'css-loader' }] } ] }
npm install -D url-loader
module: { rules: [ // 其它选项... { test: /\.(eot|woff2?|ttf|svg)(\?.*)?$/, include: [/src/], use: 'url-loader' } ] }
module: { rules: [ // 其它选项... { test: /\.(jpe?g|png?|webp|gif)(\?.*)?$/, include: [/src/], use: 'url-loader', options: { limit: 8192 //小于8KB以base64嵌入 } } ] }
npm install -D vue-loader vue-template-compiler
const VueLoaderPlugin = require('vue-loader/lib/plugin.js') module: { rules: [ // 其它选项... { test: /\.vue$/, include: [/src/], use: 'vue-loader' } ] } plugins: [ // 其它选项... new VueLoaderPlugin() ]
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> <title>m-admin</title> </head> <body> <div id="app"></div> </body> </html>
npm install -D html-webpack-plugin
const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') plugins: [ // 其它选项... new HtmlWebpackPlugin({ template: path.resolve(__dirname, '../src/index.html') }) ]
npm install -D webpack-dev-server
const webpack = require('webpack') plugins: [ // 其它选项... new webpack.HotModuleReplacementPlugin() ]
"scripts": { "dev": "webpack-dev-server --config ./build/webpack.config.js" }
The text was updated successfully, but these errors were encountered:
feat: 添加webpack #1
55d98f2
feat<config>
16ce6a7
es6/7/8 转 es5 #1
No branches or pull requests
手动搭建 vue 开发环境 - 基础
技术栈: webpack4、babel7、vue2
es6/7/8 转 es5
es6/7/8 api 转 es5
处理 css
处理 font
处理 image
处理 vue
创建 html
热更新
The text was updated successfully, but these errors were encountered: