mirror of
https://github.com/sasjs/adapter.git
synced 2025-12-11 09:24:35 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b32352a369 | ||
|
|
8c4955cb65 | ||
|
|
155f2bb0e8 |
@@ -2,19 +2,30 @@ const path = require('path')
|
||||
const webpack = require('webpack')
|
||||
const terserPlugin = require('terser-webpack-plugin')
|
||||
|
||||
const defaultPlugins = [
|
||||
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en/),
|
||||
new webpack.SourceMapDevToolPlugin({
|
||||
filename: null,
|
||||
exclude: [/node_modules/],
|
||||
test: /\.ts($|\?)/i
|
||||
})
|
||||
]
|
||||
|
||||
const optimization = {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new terserPlugin({
|
||||
parallel: true,
|
||||
terserOptions: {}
|
||||
})
|
||||
]
|
||||
}
|
||||
|
||||
const browserConfig = {
|
||||
entry: './src/index.ts',
|
||||
devtool: 'inline-source-map',
|
||||
mode: 'production',
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new terserPlugin({
|
||||
parallel: true,
|
||||
terserOptions: {}
|
||||
})
|
||||
]
|
||||
},
|
||||
optimization: optimization,
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
@@ -35,20 +46,26 @@ const browserConfig = {
|
||||
library: 'SASjs'
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en/),
|
||||
new webpack.SourceMapDevToolPlugin({
|
||||
filename: null,
|
||||
exclude: [/node_modules/],
|
||||
test: /\.ts($|\?)/i
|
||||
}),
|
||||
...defaultPlugins,
|
||||
new webpack.ProvidePlugin({
|
||||
process: 'process/browser'
|
||||
})
|
||||
]
|
||||
}
|
||||
|
||||
const browserConfigWithoutProcessPlugin = {
|
||||
entry: browserConfig.entry,
|
||||
devtool: browserConfig.devtool,
|
||||
mode: browserConfig.mode,
|
||||
optimization: optimization,
|
||||
module: browserConfig.module,
|
||||
resolve: browserConfig.resolve,
|
||||
output: browserConfig.output,
|
||||
plugins: defaultPlugins
|
||||
}
|
||||
|
||||
const nodeConfig = {
|
||||
...browserConfig,
|
||||
...browserConfigWithoutProcessPlugin,
|
||||
target: 'node',
|
||||
entry: './node/index.ts',
|
||||
output: {
|
||||
|
||||
Reference in New Issue
Block a user