cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
KoBe321
Level: Powered On

pcf-scripts: target ES6

I'm not a big Webpack/Babel/tsconfig ninja, that's why I'm asking this. 🙂

ATM this is the tsconfig file for pcf-scripts:

 

{
  "compilerOptions": {
    "jsx": "react",
    "target": "es5",
    "module": "commonjs",
    "lib": ["ES6", "DOM"],
    "strict": true,
    "strictPropertyInitialization": false
  },
  "exclude": [
    "./node_modules"
  ]
}

 

I'm using some other libs when developing my component thus I have to set target: es6 and lib: ["es2015", "dom"].

I took a look at webpackConfig.js, but didn't notice anything forbidding me to do so.

Using the new tsconfig the component compiles successfully.

So is it possible to make these changes and not break the pac tool(s)?

3 REPLIES 3
Lisabel0
Level 8

Re: pcf-scripts: target ES6

Try to post here.

ScottDurow
Level 8

Re: pcf-scripts: target ES6

I target ES6 when debugging in chrome so that you get the source maps without all the es5 transpiled code. Make sure you set it back to es5 for release otherwise your code won’t work on non-es6 supporting browsers!
KoBe321
Level: Powered On

Re: pcf-scripts: target ES6

You are right, thanks! I didn't find any settings which might transpile the code to ES5 or lower using Babel in pcf-scripts.

I checked my bundle.js and if I switch to target ES6, it stays ES6 😞

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (3,892)