dataease-dm/extensions/dataease-extensions-view/view-3dpie/view-3dpie-frontend/build/webpack.async-plugins.js
2023-08-24 17:34:35 +08:00

98 lines
2.3 KiB
JavaScript

const webpack = require('webpack')
const path = require('path')
const utils = require('./utils')
const CopyPlugin = require("copy-webpack-plugin");
const VueLoaderPlugin = require('vue-loader/lib/plugin');
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
mode: 'development',
entry: {
// PluginDemo: resolve('/src/views/PluginDemo.vue')
'3d-pie-view': resolve('/src/views/highcharts/3dpie/index.vue'),
'3d-pie-data': resolve('/src/views/highcharts/3dpie/data.vue'),
'3d-pie-type': resolve('/src/views/highcharts/3dpie/type.vue'),
'3d-pie-style': resolve('/src/views/highcharts/3dpie/style.vue')
},
output: {
path: resolve('/static/'),
filename: '[name].js'
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src')
}
},
externals: {
vue: 'vue'
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
transformAssetUrls: {
video: 'src',
source: 'src',
img: 'src',
image: 'xlink:href'
}
}
},
{
test: /.(sa|sc|c)ss$/,
use: [
{loader: 'vue-style-loader'},
'css-loader',
'sass-loader'
]
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
plugins: [
new VueLoaderPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),
new CopyPlugin([
{from: 'src/icons/svg/'}
]),
]
}