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

@@ -52,7 +52,7 @@ This section details the desktop browser, JavaScript framework, and mobile platf
| --------------- | ----------------- |
| Chrome | 79+ |
| Safari | 14+ |
| Firefox | 63+ |
| Firefox | 70+ |
| Edge | 79+ |
**Minimum JavaScript Framework Versions**

View File

@@ -71,12 +71,11 @@
"typescript": "^4.0.5"
},
"scripts": {
"build": "npm run clean && npm run build.css && stencil build --es5 --docs-json dist/docs.json && npm run cdnloader",
"build": "npm run clean && npm run build.css && stencil build --es5 --docs-json dist/docs.json",
"build.css": "npm run css.sass && npm run css.minify",
"build.debug": "npm run clean && stencil build --debug",
"build.docs.json": "stencil build --docs-json dist/docs.json",
"clean": "node scripts/clean.js",
"cdnloader": "node scripts/copy-cdn-loader.js",
"css.minify": "cleancss -O2 -o ./css/ionic.bundle.css ./css/ionic.bundle.css",
"css.sass": "sass --embed-sources src/css:./css",
"eslint": "eslint src",

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);

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 KiB

After

Width:  |  Height:  |  Size: 530 KiB

View File

@@ -201,11 +201,6 @@ export const config: Config = {
}),
],
buildEs5: 'prod',
extras: {
dynamicImportShim: true,
initializeNextTick: true,
scriptDataOpts: true
},
testing: {
moduleNameMapper: {
"@utils/test": ["<rootDir>/src/utils/test/utils"],