Skip to content

Commit

Permalink
Merge pull request #74 from TransbankDevelopers/chore/add-config-for-…
Browse files Browse the repository at this point in the history
…module

chore: add config for module
  • Loading branch information
mastudillot authored Aug 19, 2024
2 parents 7cf0145 + c058f25 commit 4c2ff07
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 41 deletions.
18 changes: 0 additions & 18 deletions babel.config.json

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "SDK Web Transbank POS",
"main": "dist/pos.js",
"module": "dist/pos.js",
"module": "dist/pos.esm.js",
"types": "dist/pos.d.ts",
"scripts": {
"start": "webpack --watch --config webpack.config.js",
Expand Down
64 changes: 42 additions & 22 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,51 @@
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");

module.exports = [
'source-map'
].map(devtool => ({
mode: 'production',
entry: './src/pos.js',
{
mode: "production",
entry: "./src/pos.js",
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'pos.js',
library: 'Transbank',
libraryTarget: 'window',
umdNamedDefine: true
path: path.resolve(__dirname, "dist"),
filename: "pos.js",
library: "Transbank",
libraryTarget: "commonjs2",
umdNamedDefine: true,
},
module: {
rules: [
]
rules: [
],
},
devtool,
devtool: "source-map",
optimization: {
minimize: true
minimize: true,
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: 'types', to: '.' }
]
})
]
}));
new CopyWebpackPlugin({
patterns: [{ from: "types", to: "." }],
}),
],
},
{
mode: "production",
entry: "./src/pos.js",
output: {
path: path.resolve(__dirname, "dist"),
filename: "pos.esm.js",
library: {
type: "module",
},
},
module: {
rules: [
],
},
devtool: "source-map",
optimization: {
minimize: true,
},
experiments: {
outputModule: true,
}
},
];

0 comments on commit 4c2ff07

Please sign in to comment.