mirror of https://github.com/nocodb/nocodb
DarkPhoenix2704
1 week ago
7 changed files with 291 additions and 190 deletions
@ -0,0 +1,91 @@
|
||||
const path = require('path'); |
||||
const { rspack } = require('@rspack/core'); |
||||
const { resolveTsAliases } = require('./build-utils/resolveTsAliases'); |
||||
|
||||
module.exports = { |
||||
entry: './src/index.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', |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
optimization: { |
||||
minimize: true, //Update this to true or false
|
||||
minimizer: [ |
||||
new rspack.SwcJsMinimizerRspackPlugin({ |
||||
minimizerOptions: { |
||||
compress: { |
||||
keep_classnames: true, |
||||
}, |
||||
}, |
||||
}), |
||||
], |
||||
nodeEnv: false, |
||||
}, |
||||
externals: { |
||||
'@nestjs/microservices': '@nestjs/microservices', |
||||
'@nestjs/microservices/microservices-module': |
||||
'@nestjs/microservices/microservices-module', |
||||
sharp: 'commonjs sharp', |
||||
'nocodb-sdk': 'nocodb-sdk', |
||||
'pg-query-stream': 'pg-query-stream', |
||||
'better-sqlite3': 'better-sqlite3', |
||||
oracledb: 'oracledb', |
||||
'pg-native': 'pg-native', |
||||
'@nestjs/graphql': '@nestjs/graphql', |
||||
}, |
||||
resolve: { |
||||
extensions: ['.tsx', '.ts', '.js', '.json'], |
||||
alias: resolveTsAliases(path.resolve('tsconfig.json')), |
||||
}, |
||||
mode: 'production', |
||||
output: { |
||||
filename: 'bundle.js', |
||||
path: path.resolve(__dirname, 'dist'), |
||||
library: 'libs', |
||||
libraryTarget: 'umd', |
||||
globalObject: "typeof self !== 'undefined' ? self : this", |
||||
}, |
||||
node: { |
||||
__dirname: false, |
||||
}, |
||||
plugins: [ |
||||
new rspack.EnvironmentPlugin({ |
||||
EE: true, |
||||
}), |
||||
new rspack.CopyRspackPlugin({ |
||||
patterns: [{ from: 'src/public', to: 'public' }], |
||||
}), |
||||
], |
||||
target: 'node', |
||||
}; |
@ -0,0 +1,90 @@
|
||||
const path = require('path'); |
||||
const { rspack } = require('@rspack/core'); |
||||
const { resolveTsAliases } = require('./build-utils/resolveTsAliases'); |
||||
|
||||
module.exports = { |
||||
entry: './src/run/local.ts', |
||||
// devtool: 'inline-source-map',
|
||||
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', |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
optimization: { |
||||
minimize: true, //Update this to true or false
|
||||
minimizer: [ |
||||
new rspack.SwcJsMinimizerRspackPlugin({ |
||||
minimizerOptions: { |
||||
compress: { |
||||
keep_classnames: true, |
||||
}, |
||||
}, |
||||
}), |
||||
], |
||||
nodeEnv: false, |
||||
}, |
||||
externals: { |
||||
'@nestjs/microservices': '@nestjs/microservices', |
||||
'@nestjs/microservices/microservices-module': |
||||
'@nestjs/microservices/microservices-module', |
||||
sharp: 'commonjs sharp', |
||||
'nocodb-sdk': 'nocodb-sdk', |
||||
'pg-query-stream': 'pg-query-stream', |
||||
'better-sqlite3': 'better-sqlite3', |
||||
oracledb: 'oracledb', |
||||
'pg-native': 'pg-native', |
||||
'@nestjs/graphql': '@nestjs/graphql', |
||||
}, |
||||
resolve: { |
||||
extensions: ['.tsx', '.ts', '.js', '.json', '.node'], |
||||
alias: resolveTsAliases(path.resolve('tsconfig.json')), |
||||
}, |
||||
mode: 'production', |
||||
output: { |
||||
filename: 'main.js', |
||||
path: path.resolve(__dirname, 'docker'), |
||||
library: 'libs', |
||||
libraryTarget: 'umd', |
||||
globalObject: "typeof self !== 'undefined' ? self : this", |
||||
}, |
||||
node: { |
||||
__dirname: false, |
||||
}, |
||||
plugins: [ |
||||
new rspack.EnvironmentPlugin({ |
||||
EE: true, |
||||
}), |
||||
], |
||||
|
||||
target: 'node', |
||||
}; |
@ -0,0 +1,91 @@
|
||||
const path = require('path'); |
||||
const { rspack } = require('@rspack/core'); |
||||
const { resolveTsAliases } = require('./build-utils/resolveTsAliases'); |
||||
|
||||
module.exports = { |
||||
entry: './src/run/timely.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', |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
optimization: { |
||||
minimize: true, //Update this to true or false
|
||||
minimizer: [ |
||||
new rspack.SwcJsMinimizerRspackPlugin({ |
||||
minimizerOptions: { |
||||
compress: { |
||||
keep_classnames: true, |
||||
}, |
||||
}, |
||||
}), |
||||
], |
||||
nodeEnv: false, |
||||
}, |
||||
externals: { |
||||
'@nestjs/microservices': '@nestjs/microservices', |
||||
'@nestjs/microservices/microservices-module': |
||||
'@nestjs/microservices/microservices-module', |
||||
sharp: 'commonjs sharp', |
||||
'nocodb-sdk': 'nocodb-sdk', |
||||
'pg-query-stream': 'pg-query-stream', |
||||
'better-sqlite3': 'better-sqlite3', |
||||
oracledb: 'oracledb', |
||||
'pg-native': 'pg-native', |
||||
'@nestjs/graphql': '@nestjs/graphql', |
||||
}, |
||||
resolve: { |
||||
extensions: ['.tsx', '.ts', '.js', '.json', '.node'], |
||||
alias: resolveTsAliases(path.resolve('./tsconfig.json')), |
||||
}, |
||||
mode: 'production', |
||||
output: { |
||||
filename: 'main.js', |
||||
path: path.resolve(__dirname, 'docker'), |
||||
library: 'libs', |
||||
libraryTarget: 'umd', |
||||
globalObject: "typeof self !== 'undefined' ? self : this", |
||||
}, |
||||
node: { |
||||
__dirname: false, |
||||
}, |
||||
plugins: [ |
||||
new rspack.EnvironmentPlugin({ |
||||
EE: true, |
||||
}), |
||||
new rspack.CopyRspackPlugin({ |
||||
patterns: [{ from: 'src/public', to: 'public' }], |
||||
}), |
||||
], |
||||
target: 'node', |
||||
}; |
@ -1,60 +0,0 @@
|
||||
const path = require('path'); |
||||
const nodeExternals = require('webpack-node-externals'); |
||||
const webpack = require('webpack'); |
||||
const CopyPlugin = require('copy-webpack-plugin'); |
||||
const TerserPlugin = require('terser-webpack-plugin'); |
||||
const { resolveTsAliases } = require('./build-utils/resolveTsAliases'); |
||||
|
||||
module.exports = { |
||||
entry: './src/index.ts', |
||||
module: { |
||||
rules: [ |
||||
{ |
||||
test: /\.tsx?$/, |
||||
exclude: /node_modules/, |
||||
use: { |
||||
loader: 'ts-loader', |
||||
options: { |
||||
transpileOnly: true, |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
optimization: { |
||||
minimize: true, //Update this to true or false
|
||||
minimizer: [ |
||||
new TerserPlugin({ |
||||
terserOptions: { |
||||
keep_classnames: true, |
||||
}, |
||||
}), |
||||
], |
||||
nodeEnv: false, |
||||
}, |
||||
externals: [nodeExternals()], |
||||
resolve: { |
||||
extensions: ['.tsx', '.ts', '.js', '.json'], |
||||
alias: resolveTsAliases(path.resolve('tsconfig.json')), |
||||
}, |
||||
mode: 'production', |
||||
output: { |
||||
filename: 'bundle.js', |
||||
path: path.resolve(__dirname, 'dist'), |
||||
library: 'libs', |
||||
libraryTarget: 'umd', |
||||
globalObject: "typeof self !== 'undefined' ? self : this", |
||||
}, |
||||
node: { |
||||
__dirname: false, |
||||
}, |
||||
plugins: [ |
||||
new webpack.EnvironmentPlugin(['EE']), |
||||
new CopyPlugin({ |
||||
patterns: [{ from: 'src/public', to: 'public' }], |
||||
}), |
||||
], |
||||
|
||||
target: 'node', |
||||
}; |
@ -1,59 +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/local.ts', |
||||
// devtool: 'inline-source-map',
|
||||
module: { |
||||
rules: [ |
||||
{ |
||||
test: /\.tsx?$/, |
||||
exclude: /node_modules/, |
||||
use: { |
||||
loader: 'ts-loader', |
||||
options: { |
||||
transpileOnly: true, |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
optimization: { |
||||
minimize: true, //Update this to true or false
|
||||
minimizer: [ |
||||
new TerserPlugin({ |
||||
terserOptions: { |
||||
keep_classnames: true, |
||||
}, |
||||
}), |
||||
], |
||||
nodeEnv: false, |
||||
}, |
||||
externals: [ |
||||
nodeExternals({ |
||||
allowlist: ['nocodb-sdk'], |
||||
}), |
||||
], |
||||
resolve: { |
||||
extensions: ['.tsx', '.ts', '.js', '.json'], |
||||
alias: resolveTsAliases(path.resolve('tsconfig.json')), |
||||
}, |
||||
mode: 'production', |
||||
output: { |
||||
filename: 'main.js', |
||||
path: path.resolve(__dirname, 'docker'), |
||||
library: 'libs', |
||||
libraryTarget: 'umd', |
||||
globalObject: "typeof self !== 'undefined' ? self : this", |
||||
}, |
||||
node: { |
||||
__dirname: false, |
||||
}, |
||||
plugins: [new webpack.EnvironmentPlugin(['EE'])], |
||||
|
||||
target: 'node', |
||||
}; |
@ -1,57 +0,0 @@
|
||||
const path = require('path'); |
||||
const nodeExternals = require('webpack-node-externals'); |
||||
const webpack = require('webpack'); |
||||
const CopyPlugin = require('copy-webpack-plugin'); |
||||
const TerserPlugin = require('terser-webpack-plugin'); |
||||
const { resolveTsAliases } = require('./build-utils/resolveTsAliases'); |
||||
|
||||
module.exports = { |
||||
entry: './src/run/timely.ts', |
||||
module: { |
||||
rules: [ |
||||
{ |
||||
test: /\.tsx?$/, |
||||
exclude: /node_modules/, |
||||
use: { |
||||
loader: 'ts-loader', |
||||
options: { |
||||
transpileOnly: true, |
||||
}, |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
|
||||
optimization: { |
||||
minimize: true, //Update this to true or false
|
||||
minimizer: [new TerserPlugin()], |
||||
nodeEnv: false, |
||||
}, |
||||
externals: [ |
||||
nodeExternals({ |
||||
allowlist: ['nocodb-sdk'], |
||||
}), |
||||
], |
||||
resolve: { |
||||
extensions: ['.tsx', '.ts', '.js', '.json'], |
||||
alias: resolveTsAliases(path.resolve('./tsconfig.json')), |
||||
}, |
||||
mode: 'production', |
||||
output: { |
||||
filename: 'main.js', |
||||
path: path.resolve(__dirname, 'docker'), |
||||
library: 'libs', |
||||
libraryTarget: 'umd', |
||||
globalObject: "typeof self !== 'undefined' ? self : this", |
||||
}, |
||||
node: { |
||||
__dirname: false, |
||||
}, |
||||
plugins: [ |
||||
new webpack.EnvironmentPlugin(['EE']), |
||||
new CopyPlugin({ |
||||
patterns: [{ from: 'src/public', to: 'public' }], |
||||
}), |
||||
], |
||||
target: 'node', |
||||
}; |
Loading…
Reference in new issue