refactor(config): remove stencil extras (#26461)

BREAKING CHANGE:

The supported version of Firefox for Ionic v7 has changed to Firefox v70+
This commit is contained in:
Liam DeBeasi
2022-12-15 17:27:28 -05:00
committed by GitHub
parent 49baad8ee6
commit bd4027b0fa
6 changed files with 2 additions and 66 deletions

View File

@@ -1,30 +0,0 @@
exports.applyPolyfills = function() { return Promise.resolve() };
exports.defineCustomElements = function(_, opts) {
return new Promise(function(resolve, reject) {
if (typeof document !== 'undefined') {
opts = opts || {};
var mod = document.createElement('script');
mod.setAttribute('type', 'module');
mod['data-opts'] = opts;
mod.src = '__CDN_LOADER_URL__/dist/ionic/ionic.esm.js';
var legacy = document.createElement('script');
legacy.setAttribute('nomodule', '');
legacy['data-opts'] = opts;
legacy.src = '__CDN_LOADER_URL__/dist/ionic/ionic.js';
mod.onload = resolve;
mod.onerror = reject;
legacy.onload = resolve;
legacy.onerror = reject;
document.head.appendChild(mod);
document.head.appendChild(legacy);
} else {
resolve();
}
});
}

View File

@@ -1,28 +0,0 @@
// the unpkg link cannot use "latest" in the url
// so this script is to keep the link updated
// with the latest
const fs = require('fs');
const path = require('path');
let version = process.argv[2];
if (version) {
version = '@' + version;
} else {
version = '';
}
const srcPath = path.join(__dirname, 'cdn-loader.js');
let scriptContent = fs.readFileSync(srcPath, 'utf-8');
// https://unpkg.com/@ionic/core@latest/dist/ionic.js
scriptContent = scriptContent.replace(
/__CDN_LOADER_URL__/g,
'https://cdn.jsdelivr.net/npm/@ionic/core' + version
);
fs.writeFileSync(path.join(__dirname, '..', 'loader', 'cdn.js'), scriptContent);
fs.writeFileSync(path.join(__dirname, '..', 'loader', 'index.cjs.js'), scriptContent);