create-powerapps-project 2.2.0 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/plopfile.js CHANGED
@@ -563,6 +563,8 @@ export default async (plop) => {
563
563
  'webpack',
564
564
  'webpack-cli',
565
565
  'cross-spawn',
566
+ 'esbuild-loader',
567
+ 'ts-loader',
566
568
  '@microsoft/eslint-plugin-power-apps',
567
569
  '-D'
568
570
  ],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-powerapps-project",
3
3
  "description": "💧 plop generator for Dataverse development",
4
- "version": "2.2.0",
4
+ "version": "2.2.3",
5
5
  "license": "MIT",
6
6
  "exports": "./lib/index.js",
7
7
  "engines": {
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "name": "{{kebabCase name}}",
4
4
  "private": true,
5
- "type": "commonjs",
5
+ "type": "module",
6
6
  "scripts": {
7
7
  "gen": "plop",
8
8
  "deploy": "dotnet build && dataverse-utils deploy assembly",
@@ -1,3 +1,3 @@
1
- module.exports = async function (plop) {
1
+ export default async function (plop) {
2
2
  await plop.load('powerapps-project-assembly');
3
- };
3
+ }
@@ -1,3 +1,3 @@
1
- module.exports = async function (plop) {
1
+ export default async function (plop) {
2
2
  await plop.load('powerapps-project-pcf');
3
- };
3
+ }
@@ -1,10 +1,10 @@
1
1
  {
2
- "extends": "./node_modules/pcf-scripts/tsconfig_base.json",
3
- "compilerOptions": {
4
- "typeRoots": ["node_modules/@types"],
5
- "esModuleInterop": true,
6
- "target": "ES6",
7
- "module": "es2015",
8
- "moduleResolution": "node"
9
- }
10
- }
2
+ "extends": "./node_modules/pcf-scripts/tsconfig_base.json",
3
+ "compilerOptions": {
4
+ "typeRoots": ["node_modules/@types"],
5
+ "esModuleInterop": true,
6
+ "target": "ES6",
7
+ "module": "es2015",
8
+ "moduleResolution": "node"
9
+ }
10
+ }
@@ -2,6 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "name": "{{kebabCase name}}",
4
4
  "private": true,
5
+ "type": "module",
5
6
  "scripts": {
6
7
  "build": "webpack --mode=production",
7
8
  "start": "webpack --mode=development --watch",
@@ -1,3 +1,3 @@
1
- module.exports = async function (plop) {
1
+ export default async function (plop) {
2
2
  await plop.load('powerapps-project-webresource');
3
- };
3
+ }
@@ -1,10 +1,14 @@
1
- const config = require('./dataverse.config.json');
2
- const path = require('path');
3
- const spawn = require('cross-spawn');
4
- const WebpackEventPlugin = require('webpack-event-plugin');
5
- const { CleanWebpackPlugin } = require('clean-webpack-plugin');
1
+ import config from './dataverse.config.json' with { type: 'json' };
2
+ import path, { dirname } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import spawn from 'cross-spawn';
5
+ import WebpackEventPlugin from 'webpack-event-plugin';
6
+ import { CleanWebpackPlugin } from 'clean-webpack-plugin';
7
+ import { EsbuildPlugin } from 'esbuild-loader';
6
8
 
7
- module.exports = (env, argv) => {
9
+ const __dirname = dirname(fileURLToPath(import.meta.url));
10
+
11
+ export default function (env, argv) {
8
12
  const webpackConfig = {
9
13
  entry: config.entries,
10
14
 
@@ -21,12 +25,15 @@ module.exports = (env, argv) => {
21
25
  module: {
22
26
  rules: [
23
27
  {
24
- test: /\.[jt]s?$/,
25
- loader: 'esbuild-loader',
26
- options: {
27
- target: 'es2020'
28
- }
29
- }
28
+ test: /\.ts(x?)$/,
29
+ exclude: /node_modules/,
30
+ use: ['esbuild-loader', 'ts-loader']
31
+ },
32
+ {
33
+ test: /\.js$/,
34
+ exclude: /node_modules/,
35
+ use: ['esbuild-loader']
36
+ },
30
37
  ]
31
38
  },
32
39
 
@@ -49,9 +56,17 @@ module.exports = (env, argv) => {
49
56
  ]
50
57
  };
51
58
 
59
+ config.optimization = {
60
+ minimizer: [
61
+ new EsbuildPlugin({
62
+ target: 'es2020'
63
+ })
64
+ ]
65
+ };
66
+
52
67
  if (argv.mode === 'development') {
53
68
  config.devtool = 'eval-source-map';
54
69
  }
55
70
 
56
71
  return webpackConfig;
57
- };
72
+ }