Skip to content

Commit

Permalink
Make babel-loader work, change compile targe to IE11
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Aug 2, 2024
1 parent c93f15c commit 7700394
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 2 deletions.
17 changes: 16 additions & 1 deletion _develop/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,24 @@ const constantPack = new DefinePlugin({
QUILL_VERSION: JSON.stringify(pkg.version),
});

const source = [
'quill.js',
'core.js',
'vaadin-quill.js',
'blots',
'core',
'formats',
'modules',
'test',
'themes',
'ui'
].map(function(file) {
return resolve(__dirname, '..', file);
});

const jsRules = {
test: /\.js$/,
include: [resolve(__dirname, 'src')],
include: source,
use: ['babel-loader'],
};

Expand Down
11 changes: 10 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ const pkg = require('./package.json');

module.exports = {
presets: [
['@babel/preset-env', { modules: false }],
[
'@babel/preset-env',
{
modules: false,
useBuiltIns: 'usage',
corejs: 3,
targets: { ie: '11' },
},
],
],
plugins: [
['@babel/plugin-transform-runtime'],
['transform-define', { QUILL_VERSION: pkg.version }],
],
};
33 changes: 33 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@
"devDependencies": {
"@babel/cli": "^7.23.9",
"@babel/core": "^7.24.0",
"@babel/plugin-transform-runtime": "^7.24.7",
"@babel/preset-env": "^7.24.0",
"babel-loader": "^9.1.3",
"babel-plugin-transform-define": "^2.1.4",
"core-js": "^3.8.0",
"css-loader": "^6.10.0",
"html-loader": "^4.2.0",
"http-proxy": "^1.16.2",
Expand Down

0 comments on commit 7700394

Please sign in to comment.