mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.4 KiB
64 lines
1.4 KiB
4 years ago
|
const nodeExternals = require('webpack-node-externals');
|
||
|
const webpack = require('webpack');
|
||
2 years ago
|
const CopyPlugin = require("copy-webpack-plugin");
|
||
4 years ago
|
//
|
||
3 years ago
|
const TerserPlugin = require('terser-webpack-plugin');
|
||
|
// const JavaScriptObfuscator = require('webpack-obfuscator');
|
||
4 years ago
|
const path = require('path');
|
||
|
module.exports = {
|
||
|
entry: './src/lib/index.ts',
|
||
|
// devtool: 'inline-source-map',
|
||
|
module: {
|
||
|
rules: [
|
||
|
{
|
||
|
test: /\.tsx?$/,
|
||
|
exclude: /node_modules/,
|
||
|
use: {
|
||
|
loader: 'ts-loader',
|
||
|
options: {
|
||
|
transpileOnly: true
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
|
||
|
optimization: {
|
||
3 years ago
|
minimize: true, //Update this to true or false
|
||
|
minimizer: [new TerserPlugin()],
|
||
4 years ago
|
nodeEnv:false
|
||
|
},
|
||
|
externals: [nodeExternals()],
|
||
|
resolve: {
|
||
|
extensions: ['.tsx', '.ts', '.js', '.json'],
|
||
|
},
|
||
|
output: {
|
||
|
filename: 'bundle.js',
|
||
|
path: path.resolve(__dirname, 'dist'),
|
||
|
library: 'libs',
|
||
|
libraryTarget: 'umd',
|
||
|
globalObject: "typeof self !== 'undefined' ? self : this"
|
||
|
},
|
||
|
node: {
|
||
2 years ago
|
fs: 'empty',
|
||
|
__dirname: false,
|
||
4 years ago
|
},
|
||
|
plugins: [
|
||
|
new webpack.EnvironmentPlugin([
|
||
|
'EE'
|
||
|
]),
|
||
2 years ago
|
new CopyPlugin({
|
||
|
patterns: [
|
||
|
{ from: 'src/lib/public', to: 'public' },
|
||
|
]
|
||
|
})
|
||
3 years ago
|
// new JavaScriptObfuscator({
|
||
|
// rotateStringArray: true,
|
||
|
// splitStrings: true,
|
||
|
// splitStringsChunkLength: 6
|
||
|
// }, []),
|
||
4 years ago
|
],
|
||
|
|
||
2 years ago
|
target: 'node'
|
||
|
};
|