Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const isDev = process.env.NODE_ENV === 'development' // 开发环境
// 增加环境变量
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYYMDHHmmss')
// 打包输出路径
const outputDir = '../../WebHost/wwwroot'
module.exports = {
outputDir: outputDir,
devServer: {
port: 5223
},
transpileDependencies: ['nm-.*', 'element-ui'],
configureWebpack: {
plugins: [
/**
* 复制nm-lib-skins/public目录下的文件到输出目录
*/
new CopyWebpackPlugin([
{
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const isDev = process.env.NODE_ENV === 'development' // 开发环境
// 增加环境变量
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYYMDHHmmss')
// 打包输出路径
const outputDir = '../../WebHost/wwwroot'
module.exports = {
outputDir: outputDir,
devServer: {
port: 5220
},
transpileDependencies: ['nm-.*', 'element-ui'],
configureWebpack: {
plugins: [
/**
* 复制nm-lib-skins/public目录下的文件到输出目录
*/
new CopyWebpackPlugin([
{
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const VueFilenameInjector = require('@d2-projects/vue-filename-injector')
const ThemeColorReplacer = require('webpack-theme-color-replacer')
const forElementUI = require('webpack-theme-color-replacer/forElementUI')
const cdnDependencies = require('./dependencies-cdn')
// 拼接路径
const resolve = dir => require('path').join(__dirname, dir)
// 增加环境变量
process.env.VUE_APP_VERSION = require('./package.json').version
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss')
// 基础路径 注意发布之前要先修改这里
let publicPath = process.env.VUE_APP_PUBLIC_PATH || '/'
// 设置不参与构建的库
let externals = {}
cdnDependencies.forEach(package => { externals[package.name] = package.library })
// 引入文件的 cdn 链接
const cdn = {
css: cdnDependencies.map(e => e.css).filter(e => e),
js: cdnDependencies.map(e => e.js).filter(e => e)
}
module.exports = {
// 根据你的实际情况更改这里
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const isDev = process.env.NODE_ENV === 'development' // 开发环境
// 增加环境变量
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYYMDHHmmss')
// 打包输出路径
const outputDir = '../WebHost/wwwroot/app'
module.exports = {
outputDir: outputDir,
publicPath: '/app',
devServer: {
port: 5220
},
transpileDependencies: ['nm-.*', 'element-ui'],
configureWebpack: {
plugins: [
/**
* 复制nm-lib-skins/public目录下的文件到输出目录
*/
new CopyWebpackPlugin([
const VueFilenameInjector = require('./tools/vue-filename-injector')
// 拼接路径
const resolve = dir => require('path').join(__dirname, dir)
// 增加环境变量
process.env.VUE_APP_VERSION = require('./package.json').version
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss')
// 基础路径 注意发布之前要先修改这里
let publicPath = process.env.VUE_APP_PATH
module.exports = {
publicPath, // 根据你的实际情况更改这里
lintOnSave: true,
devServer: {
publicPath, // 和 publicPath 保持一致
proxy: {
'/api': {
target: 'http://127.0.0.1:7070',
ws: true,
pathRewrite: {
'^/api': '/api'
}
// 增加环境变量
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYYMDHHmmss')
process.env.VUE_APP_VERSION = require('./package.json').version
const path = require('path')
module.exports = {
devServer: {
port: 6220
},
publicPath: './',
transpileDependencies: ['nm-lib-.*', 'element-ui'],
configureWebpack: {
resolve: {
// 配置解析别名
alias: {
'@': path.resolve(__dirname, './src'),
'@api': path.resolve(__dirname, './src/api'),
'@views': path.resolve(__dirname, './src/views'),
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const VueFilenameInjector = require('@d2-projects/vue-filename-injector')
const ThemeColorReplacer = require('webpack-theme-color-replacer')
const forElementUI = require('webpack-theme-color-replacer/forElementUI')
const cdnDependencies = require('./dependencies-cdn')
// 拼接路径
const resolve = dir => require('path').join(__dirname, dir)
// 增加环境变量
process.env.VUE_APP_VERSION = require('./package.json').version
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss')
// 基础路径 注意发布之前要先修改这里
let publicPath = process.env.VUE_APP_PUBLIC_PATH || '/'
// 设置不参与构建的库
let externals = {}
cdnDependencies.forEach(package => { externals[package.name] = package.library })
// 引入文件的 cdn 链接
const cdn = {
css: cdnDependencies.map(e => e.css).filter(e => e),
js: cdnDependencies.map(e => e.js).filter(e => e)
}
module.exports = {
// 根据你的实际情况更改这里
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
// 开发环境
const isDev = process.env.NODE_ENV === 'development'
// 打包输出路径
const outputDir = '../../WebHost/wwwroot/app'
// 环境变量
/**版权信息 */
process.env.VUE_APP_COPYRIGHT = '版权所有:尼古拉斯·老李 | 用代码改变世界'
/**版本号 */
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYYMDHHmmss')
/**第三方依赖组件,写法示例: */
process.env.VUE_APP_CUSTOM_SCRIPTS = ''
module.exports = {
outputDir: outputDir,
publicPath: '/app',
devServer: {
port: 5220
},
transpileDependencies: ['netmodular-*', 'element-ui'],
configureWebpack() {
let config = {
plugins: [
/**
* 复制netmodular-ui/public目录下的文件到输出目录
*/
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const VueFilenameInjector = require('./tools/vue-filename-injector')
// 拼接路径
const resolve = dir => require('path').join(__dirname, dir)
// 增加环境变量
// 注意 飞冰会在下载脚手架之后 package.json version 强制变为 1.0.0 所以在这里标记版本
process.env.VUE_APP_VERSION = '1.4.3'
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss')
// 基础路径 注意发布之前要先修改这里
let publicPath = '/'
module.exports = {
publicPath, // 根据你的实际情况更改这里
lintOnSave: true,
devServer: {
publicPath // 和 publicPath 保持一致
},
css: {
loaderOptions: {
// 设置 scss 公用变量文件
sass: {
data: `@import '~@/assets/style/public.scss';`
}
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const isDev = process.env.NODE_ENV === 'development' // 开发环境
// 增加环境变量
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYYMDHHmmss')
module.exports = {
devServer: {
port: 5226
},
transpileDependencies: ['nm-.*', 'element-ui'],
configureWebpack: {
plugins: [
/**
* 复制nm-lib-skins/public目录下的文件到输出目录
*/
new CopyWebpackPlugin([
{
from: path.join(__dirname, 'node_modules/nm-lib-skins/public'),
to: path.join(__dirname, 'dist'),
ignore: ['index.html']