You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.
I've given your plugin a try and managed to use the new es6 import syntax to import other source files and use webpack to bundle it. This loads without issue and has nice sourcemap support.
The problem came up when I tried to bring in a new module. A simple example would be uuid.
So the steps are as follows:
npm install uuid
fetch the d.ts file from definitely typed and a reference to it to my index.ts file (as an example) typescript then determines that you can import this e.g. import * as uuid from 'uuid';
call the imported file and log to the console (basic example).
It should be really simple but just doesn't work. It complains that it cannot find the module. I've tried adding moduleDirectories to the resolve part of the config and specifying the full path to the node_modules folder and even tried defining resolveLoader with modulesDirectories (because another complaint is it can't resolve source-map-loader.
Is it possible to add an extra example that has a packages.json that brings in uuid and then references it using the new es6 syntax (i also tried require)?
Thanks!
The text was updated successfully, but these errors were encountered:
@johnman I understand what's wrong. The problem is that the module you install with npm i uuid doesn't have a proper .d.ts file on DefinitelyTyped. The closest analog on DefinitelyTyped is node-uuid and you can use it, but you need to do one of those things:
Alias node-uuid to uuid to your webpack.config.js
Or add these lines to one of your project's .d.ts files:
Hi,
I've given your plugin a try and managed to use the new es6 import syntax to import other source files and use webpack to bundle it. This loads without issue and has nice sourcemap support.
The problem came up when I tried to bring in a new module. A simple example would be uuid.
So the steps are as follows:
It should be really simple but just doesn't work. It complains that it cannot find the module. I've tried adding moduleDirectories to the resolve part of the config and specifying the full path to the node_modules folder and even tried defining resolveLoader with modulesDirectories (because another complaint is it can't resolve source-map-loader.
Is it possible to add an extra example that has a packages.json that brings in uuid and then references it using the new es6 syntax (i also tried require)?
Thanks!
The text was updated successfully, but these errors were encountered: