isn"t it too big to use only one icon module in the 1.25m js file packaged by iview?
webpack:
// nodejs path
var path = require("path");
const VueLoaderPlugin=require("vue-loader/lib/plugin");
const htmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
// path.resolve()index.js
entry: path.resolve(__dirname,"./index.js"),
//
output: {
// myProject/output/static
path: path.resolve(__dirname,"./output"),
filename: "bundle.js"
},
devtool: "inline-source-map",
devServer:{
contentBase:"./output"
},
resolve: {
extensions: ["*", ".js", ".vue",".css"]
},
plugins:[
new VueLoaderPlugin(),
new htmlWebpackPlugin({
filename: "index.html",
template: "index.html",
inject: "body"
})
],
module: {
rules: [
// vue-loader .vue
{
test: /\.vue$/,
loader: "vue-loader"
},
{
test: /\.js$/,
loader: "babel-loader",
exclude: /node_modules/
}
,
{
test: /\.css$/,
use: [
"style-loader",
"vue-style-loader",
"css-loader"
]
},
{
test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/,
loader: "url-loader?limit=1024"
}
]
}
};
js:
import Vue from "vue";
import testc from "./src/components/Testc.vue";
import { Icon } from "iview";
import "iview/dist/styles/iview.css";
Vue.component("Icon",Icon);
new Vue({
el:"-sharpapp",
render:h=> h(testc)
})