1、初始化项目
vue init webpack-simple npm-vue-ui
2、修改入口文件
{
"name": "npm-vue-ui",
"description": "npm插件库",
"version": "1.0.5",
"author": "gengbigbing",
"license": "MIT",
"private": false, // 插件的话,需要设置为false
"main": "dist/build.js", // 修改这个入口文件
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies": {
"npm-vue-ui": "^1.0.5",
"vue": "^2.5.11"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.0",
"babel-preset-stage-3": "^6.24.1",
"cross-env": "^5.0.5",
"css-loader": "^0.28.7",
"file-loader": "^1.1.4",
"less": "^3.11.1",
"less-loader": "^5.0.0",
"vue-loader": "^13.0.5",
"vue-template-compiler": "^2.4.4",
"webpack": "^3.6.0",
"webpack-dev-server": "^2.9.1"
}
}
3、修改webpack(主要打包)<