-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat(index): add interpolation support (loaderUtils.interpolateName
)
#21
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example usage in config: ```js # webpack.conf.js module: { rules: [ { test: /\.js$/, use: [ "imports-loader?THREE=three", "exports-loader?THREE.[name]" ], include: helpers.root("") + "/node_modules/three/examples/js" } } ``` This allows to use all three examples as es6 or typescript modules. ```js import * as THREE from "three"; import "three/examples/js/loaders/ColladaLoader"; import "three/examples/js/controls/OrbitControls"; let loader = new THREE.ColladaLoader; let orbit = new THREE.OrbitControls; ```
Removes extra copy/pasted characters.
Adds an example for the [name] syntax.
michael-ciniawsky
changed the title
Add support for filename [name] tags in module names.
feat(index): add interpolation support for filenames (Jan 8, 2018
loaderUtils
).
michael-ciniawsky
changed the title
feat(index): add interpolation support for filenames (
feat(index): add interpolation support for filenames (Jan 8, 2018
loaderUtils
).loaderUtils
)
michael-ciniawsky
approved these changes
Jan 8, 2018
alexander-akait
approved these changes
Jan 11, 2018
Any update on this? A new version with this functionality would improve my workflow quite a bit. |
michael-ciniawsky
changed the title
feat(index): add interpolation support for filenames (
feat(index): add interpolation support (Feb 5, 2018
loaderUtils
)loaderUtils.interpolateName
)
michael-ciniawsky
added
status: Approved
and removed
pr_action: Review
priority: 4 (important)
status: Pending
labels
Feb 5, 2018
Released in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the other pull request by simonkorz has been idle for a long time, I thought I'd do it myself.
I have also made a small change in the readme to reflect the new syntax.
If a file is called file.js one could use 'exports-loader?[name]' to add 'module.exports = file;' to the file.
Example usage in config:
This allows to use all three examples as es6 or typescript modules.