-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS Project unable to build with webpack #9752
Comments
Last I knew, Typescript was against compiling file extensions into import statements. Did this change, or are webpack and typescript at odds now? @westandy does it work if you set |
@trxcllnt - I did get this to work by adding the underlying directory:
It has something to do with the files being |
@westandy could you try adding |
@trxcllnt - Neither
This gives me the same error as above. The only thing that seems to fix it is if I specify the sub file in the directory (without the extension).
|
@westandy I replicated this error locally and found a solution from this comment. I installed the latest versions of the dependencies, i.e. "scripts": {
"build": "webpack -c webpack.config.js",
},
"devDependencies": {
"ts-loader": "8.1.0",
"typescript": "4.2.3",
"webpack": "5.28.0",
"webpack-cli": "4.6.0"
},
"dependencies": {
"apache-arrow": "3.0.0"
} Here's the full working const path = require('path');
module.exports = {
target: 'node',
mode: 'production',
entry: './src/index.ts',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'umd'
},
resolve: {
extensions: ['.ts', '.mjs', '.js']
},
module: {
// keeps a ref to the native require fn for dynamic loading
noParse: /\/nativeRequire.js$/,
rules: [
{
test: /\.ts$/,
use: {
loader: 'ts-loader',
options: { configFile: 'tsconfig.prod.json' }
}
},
{
test: /\.m?js/,
resolve: {
fullySpecified: false
}
},
]
}
}; And the output:
|
@trxcllnt - I'm sorry I'm just getting back to this. It works! Rock on! Thank you! |
Steps:
npm install apache-arrow
The webpack config is here:
And my
tsonfig.prod.json
file:Error:
The text was updated successfully, but these errors were encountered: