Skip to content

Commit 25a9c8e

Browse files
committed
feat(core): remove Core JS lazy modules
1 parent 79dc849 commit 25a9c8e

File tree

8 files changed

+92
-403
lines changed

8 files changed

+92
-403
lines changed

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@
6666
"Samsung >= 12"
6767
],
6868
"dependencies": {
69-
"dom7": "^4.0.4",
69+
"dom7": "^4.0.6",
7070
"htm": "^3.1.1",
7171
"path-to-regexp": "^6.2.0",
7272
"skeleton-elements": "^4.0.1",
7373
"ssr-window": "^4.0.2",
74-
"swiper": "^9.0.0-beta.25"
74+
"swiper": "^9.0.3"
7575
},
7676
"devDependencies": {
7777
"@babel/cli": "^7.19.3",

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,11 @@
446446
"url": "https://www.patreon.com/framework7"
447447
},
448448
"dependencies": {
449-
"dom7": "^4.0.4",
449+
"dom7": "^4.0.6",
450450
"htm": "^3.1.1",
451451
"path-to-regexp": "^6.2.0",
452452
"skeleton-elements": "^4.0.1",
453453
"ssr-window": "^4.0.2",
454-
"swiper": "^9.0.0-beta.21"
454+
"swiper": "^9.0.3"
455455
}
456456
}

scripts/build-core-js.js

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -215,76 +215,8 @@ async function umdBundle({ components } = {}) {
215215
});
216216
}
217217

218-
async function umdCore() {
219-
const config = getConfig();
220-
const env = process.env.NODE_ENV || 'development';
221-
const format = process.env.FORMAT || config.format || 'umd';
222-
const output = path.resolve(`${getOutput()}`, 'core');
223-
224-
return rollup({
225-
input: './src/core/framework7.js',
226-
plugins: [
227-
replace({
228-
delimiters: ['', ''],
229-
'process.env.NODE_ENV': JSON.stringify(env), // or 'production'
230-
'process.env.FORMAT': JSON.stringify(format),
231-
'//IMPORT_COMPONENTS': '',
232-
'//INSTALL_COMPONENTS': '',
233-
'//IMPORT_HELPERS': '',
234-
'//NAMED_EXPORT': '',
235-
'export { $ as Dom7, utils, getDevice, getSupport, createStore, $jsx };': '',
236-
}),
237-
nodeResolve({ mainFields: ['module', 'main', 'jsnext'] }),
238-
babel({ babelHelpers: 'bundled' }),
239-
commonjs(),
240-
],
241-
onwarn(warning, warn) {
242-
const ignore = ['EVAL'];
243-
if (warning.code && ignore.indexOf(warning.code) >= 0) {
244-
return;
245-
}
246-
warn(warning);
247-
},
248-
})
249-
.then((bundle) => {
250-
// eslint-disable-line
251-
return bundle.write({
252-
strict: true,
253-
file: `${output}/framework7.js`,
254-
format: 'umd',
255-
name: 'Framework7',
256-
sourcemap: env === 'production',
257-
sourcemapFile: `${output}/framework7.js.map`,
258-
banner,
259-
});
260-
})
261-
.then(async (bundle) => {
262-
if (env === 'development') {
263-
return;
264-
}
265-
const result = bundle.output[0];
266-
const minified = await minify(result.code, {
267-
sourceMap: {
268-
content: env === 'production' ? result.map : undefined,
269-
filename: env === 'production' ? 'framework7.min.js' : undefined,
270-
url: `framework7.min.js.map`,
271-
},
272-
output: {
273-
preamble: banner,
274-
},
275-
});
276-
277-
fs.writeFileSync(`${output}/framework7.min.js`, minified.code);
278-
fs.writeFileSync(`${output}/framework7.min.js.map`, minified.map);
279-
})
280-
.catch((err) => {
281-
console.log(err);
282-
});
283-
}
284-
285218
async function buildJs(cb) {
286219
const config = getConfig();
287-
const env = process.env.NODE_ENV || 'development';
288220

289221
const components = [];
290222
config.components.forEach((name) => {
@@ -312,7 +244,6 @@ async function buildJs(cb) {
312244
}
313245

314246
if (!process.env.CORE_BUILD_ONLY_MODULES) {
315-
if (env !== 'development') await umdCore();
316247
await umdBundle({ components });
317248
}
318249

0 commit comments

Comments
 (0)