-
I have this setup: import path from 'path';
export default function WebpackPlugin() {
return {
name: 'webpack',
configureWebpack() {
return {
resolve: {
alias: {
"figlet": path.resolve(__dirname, './node_modules/figlet/lib/figlet.js')
}
}
};
},
};
}
Yet I keep getting error:
I use TypeScript and I need to create an alias, so I can have types for the imports. I need to use:
in file named But this throw error because it imports node module, I need to import browser version from |
Beta Was this translation helpful? Give feedback.
Answered by
jcubic
Oct 3, 2024
Replies: 1 comment
-
This seems to work: export default function WebpackPlugin() {
return {
name: 'webpack',
configureWebpack() {
return {
resolve: {
alias: {
'figlet': 'figlet/lib/figlet.js'
}
}
};
},
};
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jcubic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This seems to work: