@plattar/sdk-core
Advanced tools
Comparing version
@@ -8,2 +8,3 @@ "use strict"; | ||
const version_1 = __importDefault(require("../../version")); | ||
const util_1 = require("./util"); | ||
/** | ||
@@ -45,38 +46,20 @@ * Contains helpful functions to generate the data for a TypeScript based project | ||
static generateWebpackConfig(vars) { | ||
const webpack = `{ | ||
name: '${vars.name}', | ||
mode: 'production', | ||
devtool: 'source-map', | ||
entry: { | ||
main: ['./dist/index.js'] | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, './build'), | ||
filename: "bundle.min.js" | ||
}, | ||
module: {}, | ||
plugins: [ | ||
new CleanWebpackPlugin() | ||
], | ||
optimization: { | ||
minimize: true, | ||
minimizer: [ | ||
new TerserPlugin({ | ||
terserOptions: { | ||
format: { | ||
comments: false, | ||
}, | ||
keep_classnames: true, | ||
keep_fnames: false, | ||
sourceMap: true | ||
}, | ||
extractComments: false | ||
}), | ||
], | ||
} | ||
}`; | ||
let output = `const { CleanWebpackPlugin } = require('clean-webpack-plugin');\n`; | ||
output += `const TerserPlugin = require("terser-webpack-plugin");\n`; | ||
output += `const path = require("path");\n\n`; | ||
return `${output}\nmodule.exports=${webpack}\n`; | ||
output += `module.exports = {\n`; | ||
output += `\t name: '${vars.name}',\n`; | ||
output += `\t mode: 'production',\n`; | ||
output += `\t devtool: 'source-map',\n`; | ||
output += `\t entry: './dist/index.js',\n`; | ||
output += `\t output: {\n`; | ||
output += `\t\t library: '${util_1.Util.capitaliseClassName(vars.name.replaceAll('-', '_'))}',\n`; | ||
output += `\t\t filename: 'bundle.min.js',\n`; | ||
output += `\t\t path: path.resolve(__dirname, './build')\n`; | ||
output += `\t },\n`; | ||
output += `\t plugins: [new CleanWebpackPlugin()],\n`; | ||
output += `\t optimization: {\n`; | ||
output += `\t\t minimize: true\n`; | ||
output += `\t }\n`; | ||
output += `}\n`; | ||
return output; | ||
} | ||
@@ -94,3 +77,2 @@ /** | ||
types: 'dist/index.d.ts', | ||
sideEffects: false, | ||
scripts: { | ||
@@ -97,0 +79,0 @@ 'webpack:build': 'webpack', |
@@ -1,2 +0,2 @@ | ||
declare const _default: "1.164.2"; | ||
declare const _default: "1.164.3"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "1.164.2"; | ||
exports.default = "1.164.3"; |
{ | ||
"name": "@plattar/sdk-core", | ||
"version": "1.164.2", | ||
"version": "1.164.3", | ||
"description": "Core SDK Module for Generative SDK using API Core", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
76735
-0.51%1937
-0.92%