tsconfig-paths-snowpack-plugin

0.1.6 • Public • Published

tsconfig-paths-snowpack-plugin

npm package

Description

This is a simple plugin that will use the paths you have defined in your tsconfig.json in your snowpack configuration.

Disclaimer

I would recommend to use another pugin (see alternatives), since this is the first npm package that I have published. And I can't guarantee that it will work in every usecase.

Usage

snowpack.config.json

"plugins": [
  ["tsconfig-paths-snowpack-plugin", {/* See Options */}],
],

tsconfig.json

{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "@app/*": ["src/*"]
    },
  }
}

will be converted at build time into:

snowpack.config.js

module.exports = {
  alias: {
    "@app": "src"
  }
}

Options

Field Type Required Description
logAlias bool No This will print the modified alias of your snowpack configuration. Keep in mind that you have to set devOptions: { output: 'stream' } in your snowpack.config.js to prevent snowpack from clearing the console.

Contribution

If you have any ideas to improve the project, feel free to do so.

Alternatives

Readme

Keywords

none

Package Sidebar

Install

npm i tsconfig-paths-snowpack-plugin

Weekly Downloads

5

Version

0.1.6

License

MIT

Unpacked Size

4.4 kB

Total Files

5

Last publish

Collaborators

  • comesa