Skip to content

Comeza/tsconfig-paths-snowpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Import your tsconfig paths to your snowpack configuration

Topics

Resources

License

Stars

Watchers

Forks