79 lines
1.7 KiB
JavaScript
79 lines
1.7 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import Components from 'unplugin-vue-components/vite'
|
|
<<<<<<< HEAD
|
|
import nightwatchPlugin from 'vite-plugin-nightwatch'
|
|
=======
|
|
import nightwatchzPlugin from 'vite-plugin-nightwatch'
|
|
>>>>>>> aca797e (...)
|
|
import path from 'path'
|
|
// import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
|
|
// import requireTransform from 'vite-plugin-require-transform';
|
|
import nodePolyfills from 'rollup-plugin-polyfill-node';
|
|
|
|
export default defineConfig({
|
|
define: {
|
|
'process.env': process.env
|
|
},
|
|
plugins: [
|
|
vue(),
|
|
<<<<<<< HEAD
|
|
nightwatchPlugin(),
|
|
=======
|
|
nightwatchzPlugin({
|
|
componentType: 'vue'
|
|
}),
|
|
>>>>>>> aca797e (...)
|
|
Components({}),
|
|
// requireTransform({
|
|
// fileRegex:/.ts$|.tsx$|.vue$/
|
|
// })
|
|
],
|
|
envPrefix:"VUE_APP_",
|
|
optimizeDeps: {
|
|
esbuildOptions: {
|
|
define: {
|
|
global: "globalThis",
|
|
},
|
|
plugins: [
|
|
]
|
|
}
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
javascriptEnabled: true
|
|
},
|
|
scss: {
|
|
javascriptEnabled: true
|
|
}
|
|
}
|
|
},
|
|
productionSourceMap: true,
|
|
transpileDependencies: true,
|
|
devServer: {
|
|
open: true
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@' : path.resolve(__dirname, './src'),
|
|
|
|
process: "process/browser",
|
|
stream: "stream-browserify",
|
|
zlib: "browserify-zlib",
|
|
util: 'util',
|
|
web3: path.resolve(__dirname, 'node_modules/web3/dist/web3.min.js')
|
|
},
|
|
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
|
},
|
|
build: {
|
|
sourcemap: true,
|
|
rollupOptions: {
|
|
plugins: [nodePolyfills()],
|
|
},
|
|
commonjsOptions: {
|
|
transformMixedEsModules: true,
|
|
}
|
|
},
|
|
})
|