From d005f1f9251d3b7efc4271cbd005dfd9afd993d7 Mon Sep 17 00:00:00 2001 From: Paul Breuler <4356863+paulbreuler@users.noreply.github.com> Date: Fri, 17 Jun 2022 18:03:36 -0400 Subject: [PATCH] remove webpack and target es6 --- gulp/compile.js | 2 +- package.json | 2 +- tsconfig.json | 2 +- webpack.config.js | 28 ---------------------------- 4 files changed, 3 insertions(+), 31 deletions(-) delete mode 100644 webpack.config.js diff --git a/gulp/compile.js b/gulp/compile.js index 11df2473..47336f96 100644 --- a/gulp/compile.js +++ b/gulp/compile.js @@ -24,7 +24,7 @@ module.exports = function compile() { console.info(`packaging ${idx} "${task}" into ./dist folder ...`); esbuild.build({ entryPoints: [`./${task}`], - outfile: path.join(taskDistDir, "index.js"), + outfile: path.join(taskDistDir, "index.mjs"), platform: "node", }).catch((error) => { console.error(error); reject(error); }) }); diff --git a/package.json b/package.json index 1f3dac2b..385129cd 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@microsoft/powerplatform-build-tools", "version": "1.0.0", "engines": { - "node": ">=10.0.0" + "node": ">=14.0.0" }, "description": "Azure DevOps tasks for Power Platform", "main": "index.js", diff --git a/tsconfig.json b/tsconfig.json index e726e0e6..36f05f25 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es2018", + "target": "es6", "module": "commonjs", "outDir": "./dist", "resolveJsonModule": true, diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 27d524ad..00000000 --- a/webpack.config.js +++ /dev/null @@ -1,28 +0,0 @@ -const { resolve } = require("path"); -const find = require("find"); - -const tasks = find.fileSync(/tasks[/\\].*[/\\]index.ts$/, "src"); - -module.exports = tasks.map((task) => ({ - entry: `./${task}`, - target: "node", - externalsPresets: { node: true }, - module: { - rules: [ - { - test: /\.ts$/, - use: "ts-loader", - exclude: [/out/], - }, - ], - }, - mode: "development", - // mode: "production", - resolve: { - extensions: [".ts", ".js"], - }, - output: { - filename: task.replace(/\.ts$/, ".js").replace(/src[/\\]/, ""), - path: resolve(__dirname, "dist"), - }, -}));