updae script

This commit is contained in:
David Reed 2022-09-12 20:10:21 -04:00
parent 410c9a9d96
commit 4e97e5e86a

View file

@ -1,16 +1,22 @@
import webpack from "webpack"; import webpack from 'webpack';
import path from "path"; import { fileURLToPath } from 'url';
const __dirname = path.resolve(path.dirname(decodeURI(new URL(import.meta.url).pathname))).slice(3); const isDevelopment = process.env.NODE_ENV !== 'production';
console.log(path.resolve(path.dirname(decodeURI(new URL(import.meta.url).pathname))), __dirname); /**
* @type {webpack.Configuration}
webpack({ */
entry: path.join(__dirname, './rewrite/index.js'), const config = {
mode: isDevelopment ? 'development' : 'production',
entry: fileURLToPath(new URL('./rewrite/index.js', import.meta.url)),
output: { output: {
path: __dirname, path: fileURLToPath(new URL('./lib/', import.meta.url)),
filename: './lib/uv.bundle.js', filename: 'uv.bundle.js',
} },
}, (err, i) => performance: {
console.log(!err ? 'Ultraviolet bundled!' : e) // suppress "entrypoint size limit" warning
); hints: false,
},
};
export default config;