diff --git a/Gruntfile.js b/Gruntfile.js index ebe5848fe1..1c38169a79 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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' } }), @@ -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' } }), }, diff --git a/src/global.ts b/src/global.ts index 10d2647f29..ca260b00e7 100644 --- a/src/global.ts +++ b/src/global.ts @@ -382,4 +382,4 @@ export class M { } } -module.exports = M \ No newline at end of file +export default M; \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index d5f121ac98..5140ac58e7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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, } }; \ No newline at end of file