Releasing a pluggable widget for production

0
Hello, I have a Typescript pluggable widget which works fine with npm run dev and npm run build but when I try npm run release it is trying to run eslint and doesn’t find the eslintrc.js file. If I add a simple eslintrc.js file it won’t compile as it doesn’t like all the Typescript syntax. Does anyone know the difference between build and release? Is build sufficient for productive use? Thanks, Gregor
asked
2 answers
3

Hi Gregor,

The dev will rebuild on change

The build is a sing dev build

The release build will minify the code and remove source mapping and will move the CSS in file instead of a module.

It would be good if this info is available https://github.com/mendix/widgets-resources/tree/master/packages-common/pluggable-widgets-tools

So you could run a normal build in production. It will be slower to load (larger) and harder to overwrite the styling.

Please report issues to support, if the latest of the widget tooling is not working in a clean newly generated widget.

Cheers, Andries 

answered
1

Probably simply add a .eslintrc.js file to your root folder:

const base = require("./node_modules/@mendix/pluggable-widgets-tools/configs/eslint.ts.base.json");

module.exports = {
...base
};

When you do a release you will have to lint it first (at least the latest version of the generator complains about linting first, not being part of the release step)

npm run lint:fix

Fix any issues that come up in the linting. Then when all set and done, run

npm run release

That should do the trick

answered