Snowpack plugin adding support for using path mappings specified in tsconfig files. This is useful for projects that use Typescript and want to reuse the defined path mappings in the tsconfig as aliases in Snowpack.
Add the plugin to your Snowpack configuration:
// snowpack.config.mjs
/** @type {import("snowpack").SnowpackUserConfig } */
export default {
plugins: ['@nxtensions/tsconfig-paths-snowpack-plugin'],
};
By default the plugin will try to locate a tsconfig.json
file relative to the Snowpack root. A custom configuration file path can be specified by specifying the tsConfig
option:
// snowpack.config.mjs
/** @type {import("snowpack").SnowpackUserConfig } */
export default {
plugins: [
[
'@nxtensions/tsconfig-paths-snowpack-plugin',
{ tsConfig: 'tsconfig.app.json' },
],
],
};