前端小白vue新建webpack引入element-ui

打开项目文件夹,安装vue脚手架

前端小白vue新建webpack引入element-ui_第1张图片



全局安装vue-cli

G:\GITHUB>npm i vue-cli -g

然后就报错了

前端小白vue新建webpack引入element-ui_第2张图片

npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\absolute
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\amdefine
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\ansi-red
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\array-union
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\arrify
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\asn1
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\camelcase
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\capture-stack-trace
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\caseless
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\chardet
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\cli-spinners
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\clone
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\co
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\coffee-script
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\co-from-stream
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\commander
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\dashdash
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\decamelize
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\delayed-stream
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\combined-stream
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\duplexer3
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\enable
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\escape-string-regexp
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\esprima
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\extsprintf
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\fast-deep-equal
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\fast-json-stable-stringify
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\forever-agent
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\get-stream
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\fs.realpath
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\getpass
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\graceful-readlink
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\git-clone
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\has-ansi
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\has-flag
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\has-symbol-support-x
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\has-generators
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\hoek
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\ini
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\cryptiles
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\is-buffer
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\is-fullwidth-code-point
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\extend-shallow
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\is-object
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\is-promise
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\is-utf8
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\is-stream
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\isarray
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\buffer
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\ecc-jsbn
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\jsbn
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\json-schema
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\json-schema-traverse
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\har-validator
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\ajv
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\json-stringify-safe
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\jsonfile
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\lazy-cache
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\lodash
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\longest
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\lowercase-keys
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\form-data
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\minimatch
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\minimist
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\mute-stream
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\os-homedir
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\pend
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\performance-now
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\pinkie
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\pinkie-promise
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\proto-list
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\config-chain
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\npm-conf
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\get-proxy
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\punycode
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\repeat-string
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\center-align
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\right-align
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\rx-lite-aggregates
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\safe-buffer
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\cli-cursor
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\sntp
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\argparse
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\string_decoder
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\stringstream
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\strip-ansi
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\string-width
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\through
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\thunkify
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\thunkify-wrap
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\timed-out
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\external-editor
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\toml
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\tunnel-agent
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\tweetnacl
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\bcrypt-pbkdf
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\sshpk
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\unzip-response
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\caw
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\util-deprecate
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\verror
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\jsprim
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\win-fork
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\window-size
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\wrap-fn
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\wrappy
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\once
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\end-of-stream
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\xtend
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\yaml-js
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\yargs
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\uglify-js
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\decompress-unzip
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\decompress
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\handlebars
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\consolidate
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\inquirer
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\multimatch
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\semver
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\uid
npm WARN checkPermissions Missing write access to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\user-home
npm ERR! path C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\absolute
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\absolute'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2018-04-12T03_19_02_083Z-debug.log

之后使用cnpm安装

就可以了。

这个问题Q1需要大牛回答一下

cnpm i vue-cli -g
Downloading vue-cli to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli_tmp
Copying C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli_tmp\[email protected]@vue-cli to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli
Installing vue-cli's dependencies to C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli/node_modules
[1/20] commander@^2.9.0 installed at node_modules\[email protected]@commander
[2/20] multimatch@^2.1.0 installed at node_modules\[email protected]@multimatch
[3/20] consolidate@^0.14.0 installed at node_modules\[email protected]@consolidate
[4/20] async@^2.4.0 installed at node_modules\[email protected]@async
[5/20] rimraf@^2.5.0 existed at node_modules\[email protected]@rimraf
[6/20] minimatch@^3.0.0 installed at node_modules\[email protected]@minimatch
[7/20] semver@^5.1.0 installed at node_modules\[email protected]@semver
[8/20] ora@^1.3.0 installed at node_modules\[email protected]@ora
[9/20] chalk@^2.1.0 installed at node_modules\[email protected]@chalk
[10/20] [email protected] installed at node_modules\[email protected]@uid
[11/20] [email protected] existed at node_modules\[email protected]@coffee-script
[12/20] read-metadata@^1.0.0 installed at node_modules\[email protected]@read-metadata
[13/20] tildify@^1.2.0 installed at node_modules\[email protected]@tildify
[14/20] user-home@^2.0.0 installed at node_modules\[email protected]@user-home
[15/20] inquirer@^3.3.0 installed at node_modules\[email protected]@inquirer
[16/20] metalsmith@^2.1.0 installed at node_modules\[email protected]@metalsmith
[17/20] validate-npm-package-name@^3.0.0 installed at node_modules\[email protected]@validate-npm-package-name
[18/20] handlebars@^4.0.5 installed at node_modules\[email protected]@handlebars
[19/20] download-git-repo@^1.0.1 installed at node_modules\[email protected]@download-git-repo
[20/20] request@^2.67.0 installed at node_modules\[email protected]@request
deprecate [email protected][email protected] › coffee-script@^1.12.4 CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
Recently updated (since 2018-04-05): 4 packages (detail see file C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\node_modules\.recently_updates.txt)
  2018-04-08
    → [email protected] › cli-spinners@^1.0.1(1.3.1) (17:15:22)
    → [email protected] › aws4@^1.6.0(1.7.0) (06:24:14)
    → [email protected][email protected][email protected] › safer-buffer@^2.1.0(2.1.
2) (18:42:42)
  2018-04-07
    → [email protected][email protected] › iconv-lite@^0.4.17(0.4.21) (12:31:13)
All packages installed (253 packages installed from npm registry, used 13s, speed 464.51kB/s, json 236(1.51MB), tarball 4.46MB)
[[email protected]] link C:\Users\Administrator\AppData\Roaming\npm\vue@ -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\bin\vue
[[email protected]] link C:\Users\Administrator\AppData\Roaming\npm\vue-init@ -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-init
[[email protected]] link C:\Users\Administrator\AppData\Roaming\npm\vue-list@ -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-list

新建名为element-ui-form的webpack模板

vue init webpack-simple element-ui-form

配置什么的默认就好了

这时就会出一个element-ui-form的文件夹

前端小白vue新建webpack引入element-ui_第3张图片

进入到这个文件夹中

cd element-ui-form

初始化项目,下载依赖

cnpm i

运行项目

npm run dev

前端小白vue新建webpack引入element-ui_第4张图片

显示这个页面就代表新建模板是成功的

接下来下载elementUI插件

cnpm i element-ui --save

引入elementUI

前端小白vue新建webpack引入element-ui_第5张图片


把多余内容删除,写一个element-ui的el-button来测试是否引入了elemen-ui

前端小白vue新建webpack引入element-ui_第6张图片

然后报错

前端小白vue新建webpack引入element-ui_第7张图片



安装loader

npm install style-loader css-loader --save-dev  

然后在webpack.config.js中配置loader

var path = require('path')
var webpack = require('webpack')

module.exports = {
  entry: './src/main.js',
  output: {
    path: path.resolve(__dirname, './dist'),
    publicPath: '/dist/',
    filename: 'build.js'
  },
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          'vue-style-loader',
          'css-loader'
        ],
      },
      {
        test: /\.vue$/,
        loader: 'vue-loader',
        options: {
          loaders: {
          }
          // other vue-loader options go here
        }
      },
      {
        test: /\.(eot|svg|ttf|woff|woff2)$/,
        loader: 'file-loader'
      },    
      // {  
      //   test: /\.css$/,  
      //   loader: 'style-loader!css-loader'  
      // },
      {
        test: /\.js$/,
        loader: 'babel-loader',
        exclude: /node_modules/
      },
      {
        test: /\.(png|jpg|gif|svg)$/,
        loader: 'file-loader',
        options: {
          name: '[name].[ext]?[hash]'
        }
      }
    ]
  },
  resolve: {
    alias: {
      'vue$': 'vue/dist/vue.esm.js'
    },
    extensions: ['*', '.js', '.vue', '.json']
  },
  devServer: {
    historyApiFallback: true,
    noInfo: true,
    overlay: true
  },
  performance: {
    hints: false
  },
  devtool: '#eval-source-map'
}

if (process.env.NODE_ENV === 'production') {
  module.exports.devtool = '#source-map'
  // http://vue-loader.vuejs.org/en/workflow/production.html
  module.exports.plugins = (module.exports.plugins || []).concat([
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: '"production"'
      }
    }),
    new webpack.optimize.UglifyJsPlugin({
      sourceMap: true,
      compress: {
        warnings: false
      }
    }),
    new webpack.LoaderOptionsPlugin({
      minimize: true
    })
  ])
}

前端小白vue新建webpack引入element-ui_第8张图片


然后。。element-ui的按钮标签就出来了



你可能感兴趣的:(element-ui,element-ui,vue,webpack,node,vue-cli)