Comments (4)
@cblanquera You create virtual file at the location /server/node/webpack/custom/assets/number-one.js
. Your entry point is inside custom/src
folder. Thats why your import should rather be:
//# File: ./src/index.js
require('../assets/number-one.js')
Notice two dots at the beginning: ../
from webpack-virtual-modules.
Thanks for the reply. You are correct. Thanks again!
from webpack-virtual-modules.
I am also unable to know the require/import module id.
const virtualModules = new VirtualModulesPlugin({
'./src/project-core/TestBundle.ts': specBundle.join('\n'),
});
In src/project-core/Tester.tsx
I have
require('./TestBundle');
But I get
Module not found: Error: Can't resolve './TestBundle' in '/Workspace/tsapp/src/project-core'
What am I doing wrong ?
from webpack-virtual-modules.
@iongion This issue has been resolved, please open new issue with exact reproduction steps.
from webpack-virtual-modules.
Related Issues (20)
- [Bug] Plugin causes console noise when used alongside debug.js HOT 2
- [Feature] Support removeModule API HOT 6
- [Bug] virtual module trigger extra compilation in webpack 5 HOT 5
- [Bug] Uppercase driver letter in windows
- Incorrectly used fileWatcher, that causing writeModule not trigger recompile with webpack-dev-server HOT 1
- [Feature] GetModule/ReadModule API HOT 2
- [Bug] Using React/JSX with `webpack-virtual-modules` gives error even when `@babel/preset-react` is used HOT 1
- [Bug] HOT 1
- [Question] - Is it possible generate new virtual modules based on file-system changes? HOT 1
- [Bug] ModuleNotFoundError happened ,when I compile two project in the same progress HOT 3
- [Bug] Local version of webpack-virtual-modules in next-with-linaria HOT 3
- [Question] Next.js compatibility
- [Bug] Multiple config and broken invalidation right from the start HOT 10
- [Feature] Custom URI scheme
- What are some real usecases of this plugin? HOT 1
- [Bug] Infinite loop on the webpack 5 example HOT 8
- [Bug] Question: Trigger webpack rebuild HOT 7
- [Feature] Expose types HOT 1
- [Bug] Stale virtual module contents upon ".writeModule" HOT 6
- [Bug] Compatibility with AngularCompilerPlugin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webpack-virtual-modules.