老师帮忙看看library
来源:5-1 Library 的打包
hy_wang
2020-11-24
老师可以帮我看下这个问题吗。
我本地搭了一个vue的组件库使用npm link。
然后新创建一个vueci项目引入使用,然后dev后项目。但是不知道为什么一直eslint报错。我不清楚是哪里的问题希望老师帮忙看看
// eslint 配置 module.exports = { "env": { "browser": true, "es2020": true }, "extends": ["plugin:vue/essential", "eslint:recommended"], "parserOptions": { "ecmaVersion": 10, "sourceType": "module" }, "plugins": [ "vue" ], // webpack.config.js const path = require('path') const VueLoaderPlugin = require('vue-loader/lib/plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin'); module.exports = { entry: path.resolve(__dirname, '../src/index.js'), output: { filename: "[name].js", path: path.resolve(__dirname, '../lib'), library: 'Nx', libraryTarget: 'umd' }, externals: ["vue"], module: { rules: [{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }, { test: /\.vue$/, loader: 'vue-loader' }, { test: /\.css$/, use: [ MiniCssExtractPlugin.loader, { loader: "css-loader" } ] }, { test: /\.scss$/, use: [ MiniCssExtractPlugin.loader, { loader: "css-loader", options: { importLoaders: 2, // modules:true } }, "sass-loader", "postcss-loader" ] } ] }, plugins: [ new VueLoaderPlugin(), new MiniCssExtractPlugin() ] } "rules": {} };
写回答
2回答
-
hy_wang
提问者
2020-11-24
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Nx=t():e.Nx=t()}(self,(function(){return(()=>{"use strict";var e={648:(e,t,o)=>{o.r(t),o.d(t,{default:()=>f});const r="testaaa",n="test";function f(e){e.component(r.name,r),e.component(n.name,n)}}},t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}return o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o(648)})()}));
00 -
Dell
2020-11-24
lib/main.js打开我看下代码
022020-11-26
相似问题