Skip to content

Commit

Permalink
fix IE11 + formatting webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
AddMoreScripts committed Mar 30, 2022
1 parent 4f811de commit f035945
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 55 deletions.
31 changes: 15 additions & 16 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{
"presets": [
[
"@babel/env",
{
"targets": {
"ie": "11"
}
}
]
],

"plugins": [
"@babel/plugin-transform-object-assign",
// "@babel/plugin-proposal-class-properties"
// "@babel/plugin-proposal-private-methods"
"presets": [
[
"@babel/env",
{
"targets": {
"ie": "11"
}
}
]
}
],
"plugins": [
"@babel/plugin-transform-object-assign",
// "@babel/plugin-proposal-class-properties"
// "@babel/plugin-proposal-private-methods"
]
}
2 changes: 1 addition & 1 deletion dist/hystmodal.min.js

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

3 changes: 2 additions & 1 deletion src/hystmodal.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ export default class HystModal {
if (!this.config.backscroll) return;

// collect fixed selectors to array
const fixedSelectors = document.querySelectorAll(this.config.fixedSelectors);
const fixedSelectorsElems = document.querySelectorAll(this.config.fixedSelectors);
const fixedSelectors = Array.prototype.slice.call(fixedSelectorsElems);

const html = document.documentElement;
if (this.isOpened === true) {
Expand Down
72 changes: 35 additions & 37 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,39 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');



module.exports = {
mode: 'production',
optimization: {
minimizer: [new TerserPlugin(), new OptimizeCSSAssetsPlugin({})],
},
entry: {
main: './src/index.js'
},
output: {
filename: 'hystmodal.min.js',
// library: 'HystModal',
// libraryTarget: 'umd',
// globalObject: 'this',
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
loader: "babel-loader",
},
{
test: /\.css$/i,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
],
},
]
},
plugins: [
new MiniCssExtractPlugin({
filename: 'hystmodal.min.css',
}),
]
};
mode: 'production',
optimization: {
minimizer: [new TerserPlugin(), new OptimizeCSSAssetsPlugin({})],
},
entry: {
main: './src/index.js',
},
output: {
filename: 'hystmodal.min.js',
// library: 'HystModal',
// libraryTarget: 'umd',
// globalObject: 'this',
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
},
{
test: /\.css$/i,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
],
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: 'hystmodal.min.css',
}),
],
};

0 comments on commit f035945

Please sign in to comment.