1 Star 0 Fork 0

Eyelly Wu/vue-printer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.config.js 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
Eyelly Wu 提交于 2019-09-15 16:21 . add component
const { resolve } = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = (env) => {
let target = ''
switch (env) {
case 'dist':
target = 'var'
break
case 'lib':
target = 'commonjs2'
break
}
return {
mode: 'production',
entry: './src/index.ts',
output: {
path: resolve(__dirname, env),
filename: 'index.js',
library: 'Printer',
libraryTarget: target
},
resolve: {
extensions: ['vue', '.ts', '.js']
},
externals: {
vue: {
umd: 'Vue',
commonjs: 'Vue',
commonjs2: 'Vue',
root: 'Vue'
}
},
module: {
rules: [
{
test: /.(js|ts)x?$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-env',
{
'targets': {
'esmodules': false
},
'modules': 'umd'
}],
'@babel/preset-typescript'
],
plugins: ["add-module-exports"]
}
},
{
test: /.vue$/,
loader: 'vue-loader'
}
]
},
plugins: [
new VueLoaderPlugin()
]
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/eyelly/vue-printer.git
git@gitee.com:eyelly/vue-printer.git
eyelly
vue-printer
vue-printer
master

搜索帮助