Skip to content

Commit

Permalink
fix: move back to old version of imports-loader
Browse files Browse the repository at this point in the history
this fixes the issue with xblocks not loading in studio. it also requires use of the deprecated "string as loader options" method for imports and exports loader config
  • Loading branch information
brian-smith-tcril committed Apr 19, 2024
1 parent 14b113c commit 27d33d4
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 68 deletions.
36 changes: 13 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"file-loader": "^6.2.0",
"font-awesome": "4.7.0",
"hls.js": "0.14.17",
"imports-loader": "^5.0.0",
"imports-loader": "0.7.1",
"jest-environment-jsdom": "^26.0.0",
"jquery": "2.2.4",
"jquery-migrate": "1.4.1",
Expand Down
79 changes: 35 additions & 44 deletions webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,11 @@ module.exports = Merge.smart({
use: [
{
loader: 'exports-loader',
options: { exports: 'window.XBlock' }
options: 'window.XBlock'
},
{
loader: 'imports-loader',
options: {
imports: [
"jquery",
"default jquery immediateDescendents",
],
wrapper: 'window'
}
options: 'jquery,jquery.immediateDescendents,this=>window'
}
]
},
Expand All @@ -261,14 +255,11 @@ module.exports = Merge.smart({
use: [
{
loader: 'exports-loader',
options: { exports: 'window.XBlock' }
options: 'window.XBlock'
},
{
loader: 'imports-loader',
options: {
imports: "default xblock/core XBlock",
wrapper: 'window'
}
options: 'XBlock=xblock/core,this=>window'
}
]
},
Expand Down Expand Up @@ -300,7 +291,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -309,7 +300,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -318,7 +309,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -327,7 +318,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -336,7 +327,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -345,7 +336,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -354,7 +345,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -363,7 +354,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -372,7 +363,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -381,7 +372,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -390,7 +381,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -399,7 +390,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -408,7 +399,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -417,7 +408,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -426,7 +417,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -435,7 +426,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -444,7 +435,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -453,7 +444,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -462,7 +453,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -471,7 +462,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -480,7 +471,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -489,7 +480,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -498,7 +489,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -510,7 +501,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'exports-loader',
options: { exports: 'window.CodeMirror' }
options: 'window.CodeMirror'
}
]
},
Expand All @@ -519,7 +510,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -528,11 +519,11 @@ module.exports = Merge.smart({
use: [
{
loader: 'exports-loader',
options: { exports: 'window.XModule' }
options: 'window.XModule'
},
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
],
},
Expand All @@ -541,7 +532,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { exports: 'false' }
options: 'exports=>false'
}
]
},
Expand All @@ -562,7 +553,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -572,7 +563,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand All @@ -584,7 +575,7 @@ module.exports = Merge.smart({
use: [
{
loader: 'imports-loader',
options: { wrapper: 'window' }
options: 'this=>window'
}
]
},
Expand Down

0 comments on commit 27d33d4

Please sign in to comment.