mirror of https://github.com/nocodb/nocodb
DarkPhoenix2704
3 weeks ago
5 changed files with 1434 additions and 335 deletions
@ -0,0 +1,75 @@
|
||||
const path = require('path'); |
||||
const { rspack } = require('@rspack/core'); |
||||
const { resolveTsAliases } = require('../build-utils/resolveTsAliases'); |
||||
const nodeExternals = require('webpack-node-externals'); |
||||
module.exports = { |
||||
entry: './src/run/dockerEntry.ts', |
||||
module: { |
||||
rules: [ |
||||
{ |
||||
test: /\.node$/, |
||||
loader: 'node-loader', |
||||
options: { |
||||
name: '[path][name].[ext]', |
||||
}, |
||||
}, |
||||
{ |
||||
test: /\.tsx?$/, |
||||
exclude: /node_modules/, |
||||
loader: 'builtin:swc-loader', |
||||
options: { |
||||
jsc: { |
||||
parser: { |
||||
syntax: 'typescript', |
||||
tsx: true, |
||||
decorators: true, |
||||
dynamicImport: true, |
||||
}, |
||||
transform: { |
||||
legacyDecorator: true, |
||||
decoratorMetadata: true, |
||||
}, |
||||
target: 'es2017', |
||||
}, |
||||
module: { |
||||
type: 'commonjs', |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
resolve: { |
||||
extensions: ['.tsx', '.ts', '.js', '.json'], |
||||
alias: resolveTsAliases(path.resolve('tsconfig.json')), |
||||
}, |
||||
output: { |
||||
path: require('path').resolve('./docker'), |
||||
filename: 'main.js', |
||||
library: 'libs', |
||||
libraryTarget: 'umd', |
||||
globalObject: "typeof self !== 'undefined' ? self : this", |
||||
}, |
||||
optimization: { |
||||
minimize: true, //Update this to true or false
|
||||
minimizer: [ |
||||
new rspack.SwcJsMinimizerRspackPlugin({ |
||||
minimizerOptions: { |
||||
compress: { |
||||
keep_classnames: true, |
||||
}, |
||||
}, |
||||
}), |
||||
], |
||||
nodeEnv: false, |
||||
}, |
||||
externals: [nodeExternals()], |
||||
plugins: [ |
||||
new rspack.EnvironmentPlugin({ |
||||
EE: true, |
||||
}), |
||||
], |
||||
target: 'node', |
||||
node: { |
||||
__dirname: false, |
||||
}, |
||||
}; |
@ -1,51 +0,0 @@
|
||||
const path = require('path'); |
||||
const nodeExternals = require('webpack-node-externals'); |
||||
const webpack = require('webpack'); |
||||
const TerserPlugin = require('terser-webpack-plugin'); |
||||
const { resolveTsAliases } = require('../build-utils/resolveTsAliases'); |
||||
|
||||
module.exports = { |
||||
entry: './src/run/dockerEntry.ts', |
||||
module: { |
||||
rules: [ |
||||
{ |
||||
test: /\.tsx?$/, |
||||
exclude: /node_modules/, |
||||
use: { |
||||
loader: 'ts-loader', |
||||
options: { |
||||
transpileOnly: true, |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
resolve: { |
||||
extensions: ['.tsx', '.ts', '.js', '.json'], |
||||
alias: resolveTsAliases(path.resolve('tsconfig.json')), |
||||
}, |
||||
output: { |
||||
path: require('path').resolve('./docker'), |
||||
filename: 'main.js', |
||||
library: 'libs', |
||||
libraryTarget: 'umd', |
||||
globalObject: "typeof self !== 'undefined' ? self : this", |
||||
}, |
||||
optimization: { |
||||
minimize: true, //Update this to true or false
|
||||
minimizer: [ |
||||
new TerserPlugin({ |
||||
terserOptions: { |
||||
keep_classnames: true, |
||||
}, |
||||
}), |
||||
], |
||||
nodeEnv: false, |
||||
}, |
||||
externals: [nodeExternals()], |
||||
plugins: [new webpack.EnvironmentPlugin(['EE'])], |
||||
target: 'node', |
||||
node: { |
||||
__dirname: false, |
||||
}, |
||||
}; |
Loading…
Reference in new issue