Questions tagged [exports-loader]
10 questions
3
votes
2 answers
Import angularjs minified version
I'm using webpack, angular 1.x and have the following code
import angular from 'angular';
which works good, but the problem is that included file is too big (angularjs - 1.15mb). It will be better of course to use minified version of angularjs, but…

Rashad Ibrahimov
- 3,279
- 2
- 18
- 39
2
votes
1 answer
Using Imports-Loader and Exports-Loader at same time for legacy code
I have 2 legacy JS files, which I do not want to change. For that reason I want to use exports-loader and imports-loader
File B-legacy needs the global var GLOB from File A-legacy
My webpack.config.js results in
rules: [
{ test: /\.ts$/,…

Daniel R
- 1,122
- 8
- 16
1
vote
1 answer
Why does the "exports-loader" example in Webpack's documentation not work?
Webpack provides the example below in its shimming documentation. In the global exports portion of that page, it gives the following example.
webpack.config.js
module.exports = {
module: {
rules: [
{
test:…

Matt
- 23,363
- 39
- 111
- 152
1
vote
0 answers
Create npm package using webpack, exports-loader and legacy JavaScript
I am trying to use a legacy JavaScript in a npm package to distribute to other projects.
If I import the Javascript file directly into one of the projects with help of webpack's exports-loader I am able to use all of the functions without any…

LocalMagic
- 107
- 1
- 7
1
vote
1 answer
Import ReactJS Component in browser as a Script
I wrote a component in reactJS that renders a tree
I am unable to import it directly to browser and keep getting this error:
Uncaught Error: Module name "TreeComponent" has not been loaded yet for context: _. Use…

Danilo Silva
- 121
- 10
1
vote
0 answers
loader in require not executed
I use the lib js-aruco which is browser only. Thats why I try to shim that lib. I do it this way:
module.exports = require('exports-loader?CV!../js-aruco/src/cv.js')
In the bundle I can see the libraray included - but the module.exports = CV is…

Fuzzyma
- 7,619
- 6
- 28
- 60
1
vote
1 answer
How to fix module exports not defined in javascript
module.exports = {
LogValue1: function (data)
{
return somevalue;
},
};
var fetch = require('./static/fetchData');
fetch.LogValue1(data);

Jyoti Raj Sharma
- 91
- 1
- 3
- 10
1
vote
1 answer
how does webpack process this module shimming pattern?
webpack's documentation lists an interesting pattern for shimming a module that sets properties on window, like window.XModule =…

Hristo
- 45,559
- 65
- 163
- 230
0
votes
1 answer
Using require.resolve in webpack config yields runtime error: "The provided value"..."is not an absolute path!"
I am attempting to use the exports-loader with my webpack config, but I'm running into an issue when trying to configure it.
webpack.config.js
module.exports = {
module: {
rules: [
{
test:…

Matt
- 23,363
- 39
- 111
- 152
0
votes
2 answers
$ is an empty object when bundled using webpack-2
Recently, I have been thinking of moving our build process from Grunt to webpack-2. Our code is entirely written in AMD format using requirejs. For the purpose of the demo, I'll post the minimalistic version of our index.js file we are using.
Here's…

softvar
- 17,917
- 12
- 55
- 76