Skip to content

Configuration for Existing Applications

Info

If you created the extension with Extension CLI, this setup is already done for you, and you may skip this step.

Before using Extension CLI with an existing application, add these configuration options to project's package.json:

Babel Presets

This is needed to compile projects written in modern JavaScript syntax.

1
2
3
4
5
"babel": {
  "presets": [
    "@babel/preset-env"
  ]
}

ESLint Ignore

Exclude test files from being linted. If your project includes compiled 3rd party libraries, you should exclude them also.

1
2
3
"eslintIgnore": [
    "test/**/*"
]

Add Scripts

Add these to package.json scripts section:

1
2
3
4
5
6
7
8
"scripts": {
  "start": "xt-build -e dev -w",
  "build": "xt-build -e prod",
  "clean": "xt-clean",
  "docs": "xt-docs",
  "test": "xt-test",
  "coverage": "nyc --reporter=lcov npm run test"
}