Skip to content

Commit

Permalink
fix: library does not load in webpack projects materializecss#364
Browse files Browse the repository at this point in the history
  • Loading branch information
danice committed May 4, 2023
1 parent 76453bf commit f4505d4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ module.exports = function(grunt) {
output: {
filename: 'materialize.js',
path: path.resolve(__dirname, 'dist/js'),
libraryTarget: 'var',
library: 'M'
libraryTarget: 'umd',
globalObject: 'this'
}
}),

Expand All @@ -140,8 +140,8 @@ module.exports = function(grunt) {
output: {
filename: 'materialize.min.js',
path: path.resolve(__dirname, 'dist/js'),
libraryTarget: 'var',
library: 'M'
libraryTarget: 'umd',
globalObject: 'this'
}
}),
},
Expand Down
2 changes: 1 addition & 1 deletion src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,4 @@ export class M {
}
}

module.exports = M
export default M;
7 changes: 5 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ module.exports = {
output: {
filename: 'materialize.js',
path: path.resolve(__dirname, 'bin'),
libraryTarget: 'var',
library: 'M'
libraryTarget: 'umd',
globalObject: 'this'
},
optimization: {
minimize: false,
}
};

0 comments on commit f4505d4

Please sign in to comment.