https://github.com/nsaunders/execute-module-loader
Build-time module execution in a Webpack loader
https://github.com/nsaunders/execute-module-loader
Last synced: 2 months ago
JSON representation
Build-time module execution in a Webpack loader
- Host: GitHub
- URL: https://github.com/nsaunders/execute-module-loader
- Owner: nsaunders
- License: mit
- Created: 2023-01-02T21:45:08.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-10-06T20:41:52.000Z (over 2 years ago)
- Last Synced: 2025-03-03T13:48:23.282Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 178 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This is a Webpack loader that allows you to execute a module at build time. It
was originally taken from
[a Webpack test case](https://github.com/webpack/webpack/tree/main/test/configCases/loader-import-module/css).
## Default behavior
Given an ES module, the `export default` value will be used. For CommonJS modules, the `module.exports` value will be used.
> **Warning**
> The value must be a string, or else compilation will fail.
## Options
**export**: string
An export whose value to return as the module output. The value must be a string.
**module**: boolean
When enabled, all exports will be included in the module output, encoded in a stringified JSON object.