I have a VS Code extension which I want to bundle using Webpack.
// webpack.config.js:
'use strict';
const path = require('path');
const webpack = require('webpack');
const config = {
target: 'webworker',
entry: './src/extension.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'extension.js',
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../[resource-path]'
},
devtool: 'source-map',
externals: {
vscode: 'commonjs vscode'
},
resolve: {
mainFields: ['browser', 'module', 'main'],
extensions: ['.ts', '.js'],
},
stats: {
errorDetails: true,
children: true,
logging: 'verbose'
},
module: {
rules: [
{
test: /.ts$/,
exclude: /node_modules/,
use: [{
loader: 'ts-loader',
options: {
compilerOptions: {
"module": "es6"
}
}
}],
}
]
}
};
module.exports = config;
package.json script section is as follows:
"scripts": {
"vscode:prepublish": "webpack --mode production",
"webpack": "webpack --mode development",
"webpack-dev": "webpack --mode development --watch",
"test-compile": "tsc -p ./"
},
When I try to build the project, it shows the following error:
ERROR in ../../../../../phxadenas101.oraclevcn.com/phx_wd202_db/WINDOWS.X64.rdd/240509/pack/src/extension.ts
Module build failed (from ../../../../../moaadil/.ade/view_storage/moaadil_new_code9/odtvscode/src/client/oracle-vscode-extension/node_modules/ts-loader/index.js):
Error: ENOENT: no such file or directory, open 'C:ADEphxadenas101.oraclevcn.comphx_wd202_dbWINDOWS.X64.rdd240509packextension.ts'
The Error Logs are as follows:
LOG from webpack.Compiler
<t> make hook: 205.42232 ms
<t> finish make hook: 0.09599 ms
<t> finish compilation: 3.47329 ms
<t> seal compilation: 253.97149 ms
<t> afterCompile hook: 0.08616 ms
LOG from webpack.Compilation
<t> compute affected modules: 0.34445 ms
<t> finish modules: 2.39043 ms
<t> report dependency errors and warnings: 0.13842 ms
<t> optimize dependencies: 1.92586 ms
<t> create chunks: 3.60265 ms
<t> compute affected modules with chunk graph: 0.27417 ms
<t> optimize: 11.00395 ms
1 modules hashed, 0 from cache (1 variants per module in average)
<t> module hashing: 2.85093 ms
100% code generated (1 generated, 0 from cache)
<t> code generation: 2.7763 ms
<t> runtime requirements.modules: 0.21028 ms
<t> runtime requirements.chunks: 0.81756 ms
<t> runtime requirements.entries: 0.67766 ms
<t> runtime requirements: 2.35274 ms
<t> hashing: initialize hash: 0.01921 ms
<t> hashing: hash errors: 0.0134 ms
<t> hashing: sort chunks: 0.11652 ms
<t> hashing: hash runtime modules: 0.08556 ms
<t> hashing: hash chunks: 3.26823 ms
<t> hashing: hash digest: 0.09857 ms
<t> hashing: process full hash modules: 0.01031 ms
<t> hashing: 4.39249 ms
<t> module assets: 0.14279 ms
<t> create chunk assets: 4.06871 ms
<t> process assets: 218.9624 ms
LOG from webpack.FlagDependencyExportsPlugin
<t> restore cached provided exports: 0.70847 ms
<t> figure out provided exports: 0.02832 ms
0% of exports of modules have been determined (1 no declared exports, 0 not cached, 0 flagged uncacheable, 0 from cache, 0 from mem cache, 0 additional calculations due to dependencies)
<t> store provided exports into cache: 0.03432 ms
LOG from webpack.SideEffectsFlagPlugin
<t> update dependencies: 0.23559 ms
LOG from webpack.FlagDependencyUsagePlugin
<t> initialize exports usage: 0.0861 ms
<t> trace exports usage in graph: 0.70691 ms
LOG from webpack.buildChunkGraph
<t> visitModules: prepare: 0.27698 ms
<t> visitModules: visiting: 1.06934 ms
2 queue items processed (1 blocks)
0 chunk groups connected
0 chunk groups processed for merging (0 module sets, 0 forked, 0 + 0 modules forked, 0 + 0 modules merged into fork, 0 resulting modules)
0 chunk group info updated (0 already connected chunk groups reconnected)
<t> visitModules: 2.1249 ms
<t> connectChunkGroups: 0.10829 ms
<t> cleanup: 0.05732 ms
LOG from webpack.SplitChunksPlugin
<t> prepare: 0.04901 ms
<t> modules: 1.99088 ms
<t> queue: 0.01594 ms
<t> maxSize: 0.11632 ms
LOG from webpack.ModuleConcatenationPlugin
<t> select relevant modules: 0.24129 ms
<t> sort relevant modules: 0.01742 ms
<t> find modules to concatenate: 0.01966 ms
<t> sort concat configurations: 0.01326 ms
<t> create concatenated modules: 0.11737 ms
+ 3 hidden lines
LOG from webpack.FileSystemInfo
0 new snapshots created
0% root snapshot uncached (0 / 0)
0% children snapshot uncached (0 / 0)
0 entries tested
File info in cache: 0 timestamps 0 hashes 0 timestamp hash combinations
Directory info in cache: 0 timestamps 0 hashes 0 timestamp hash combinations
Managed items info in cache: 0 items
I am not sure how it is getting the path to extension.ts with all the rdd info. my project file is pack. My directory structure is a s follows:
.vscode
src
- <other code files here>
- extension.ts
dist
- extension.js
package.json
webpack.config.js