docz
docz copied to clipboard
Linked typescript module "You may need an appropriate loader to handle this file type"
Bug Report
I have components library written with Typescript that uses my @some_scope/utils package that is linked with yarn link to node_modules. I have the following doczrc.js configuration:
import { css } from 'docz-plugin-css';
export default {
title: 'UIKit Elm',
typescript: true,
plugins: [
css({
preprocessor: 'less',
cssmodules: true
})
]
};
During docs compiling process there is a quick error:
Could not find dependency version for @some_scope/utils
But eventually, it finds this module but can't understand it (I think that webpack typescript loader just missed this path) and the following message stays at the end:
Failed to compile.
../utils/src/utils/uuid.ts 11:22
Module parse failed: Unexpected token (11:22)
You may need an appropriate loader to handle this file type.
> export const uuid = (N: number = 4) => ...
I tried to use modifyBundlerConfig to modify webpack config based on this issue but with no success. Besides linked modules all works fine. How to configure docz or its webpack config in order it could understand typescript within linked modules?
Environment
- OS: OSX 10.14.3
- Node/npm version: Node 10.9.0/npm 6.2.0/yarn 1.13.0