mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
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:
@@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -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);
|
||||
Reference in New Issue
Block a user