Skip to content

Commit b449448

Browse files
committed
Merge branch 'update-ef-0-15-2' of https://github.com/ClassicOldSong/js-framework-benchmark into ClassicOldSong-update-ef-0-15-2
2 parents 88011d1 + 0cf9440 commit b449448

22 files changed

+4316
-6025
lines changed

frameworks/keyed/ef-js/config/bs-config.js

Lines changed: 0 additions & 98 deletions
This file was deleted.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
|--------------------------------------------------------------------------
3+
| Browser-sync config file
4+
|--------------------------------------------------------------------------
5+
|
6+
| For up-to-date information about the options:
7+
| http://www.browsersync.io/docs/options/
8+
|
9+
| There are more options than you see here, these are just the ones that are
10+
| set internally. See the website for more info.
11+
|
12+
|
13+
*/
14+
import history from 'connect-history-api-fallback'
15+
16+
export default {
17+
ui: false,
18+
files: 'dev/index.html',
19+
watchOptions: {},
20+
server: {
21+
baseDir: './dev'
22+
},
23+
proxy: false,
24+
port: 3000,
25+
middleware: [
26+
history()
27+
],
28+
serveStatic: [],
29+
ghostMode: {
30+
clicks: true,
31+
scroll: true,
32+
forms: {
33+
submit: true,
34+
inputs: true,
35+
toggles: true
36+
}
37+
},
38+
logLevel: 'info',
39+
logPrefix: 'BS',
40+
logConnections: false,
41+
logFileChanges: true,
42+
logSnippet: true,
43+
rewriteRules: false,
44+
open: 'local',
45+
browser: 'default',
46+
cors: false,
47+
xip: false,
48+
hostnameSuffix: false,
49+
reloadOnRestart: false,
50+
notify: false,
51+
scrollProportionally: true,
52+
scrollThrottle: 0,
53+
scrollRestoreTechnique: 'window.name',
54+
scrollElements: [],
55+
scrollElementMapping: [],
56+
reloadDelay: 0,
57+
reloadDebounce: 0,
58+
reloadThrottle: 0,
59+
plugins: [],
60+
injectChanges: true,
61+
startPath: null,
62+
minify: true,
63+
host: null,
64+
localOnly: false,
65+
codeSync: true,
66+
timestamps: true,
67+
clientEvents: ['scroll', 'scroll:element', 'input:text', 'input:toggles', 'form:submit', 'form:reset', 'click'],
68+
socket: {
69+
socketIoOptions: {
70+
log: false
71+
},
72+
socketIoClientConfig: {
73+
reconnectionAttempts: 50
74+
},
75+
path: '/browser-sync/socket.io',
76+
clientPath: '/browser-sync',
77+
namespace: '/browser-sync',
78+
clients: {
79+
heartbeatTimeout: 5000
80+
}
81+
},
82+
tagNames: {
83+
less: 'link',
84+
scss: 'link',
85+
css: 'link',
86+
jpg: 'img',
87+
jpeg: 'img',
88+
png: 'img',
89+
svg: 'img',
90+
gif: 'img',
91+
js: 'script'
92+
}
93+
}

frameworks/keyed/ef-js/config/ef.config.js renamed to frameworks/keyed/ef-js/config/ef.config.mjs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1+
import { createRequire } from 'module'
2+
const require = createRequire(import.meta.url)
3+
14
import camelCase from 'camelcase'
25

3-
import packageInfo from '../package.json'
6+
const packageInfo = require('../package.json')
47

58
const production = process.env.NODE_ENV === 'production'
69
const getOutputPath = (relativePath) => {
710
if (production) return `dist/${relativePath}`
8-
return `dist/${relativePath}`
11+
return `dev/${relativePath}`
912
}
1013

1114
export default {
1215
efCoreModule: 'EFCore',
1316
input: 'src/main.js',
14-
name: camelCase(packageInfo.name, {pascalCase: true}),
17+
name: camelCase(packageInfo.name, { pascalCase: true }),
1518
format: 'iife', // Choose from iife, amd, umd, cjs, esm, system
1619
bundle: 'main',
17-
devPath: 'dist',
20+
devPath: 'dev',
1821
proPath: 'dist',
1922
copyOptions: [
2023
[
Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import del from 'del'
1+
import { deleteSync } from 'del'
22
import path from 'path'
33
import chalk from 'chalk'
44

@@ -12,34 +12,29 @@ import json from '@rollup/plugin-json'
1212
import eft from 'rollup-plugin-eft'
1313
import postcss from 'rollup-plugin-postcss'
1414
import inject from '@rollup/plugin-inject'
15-
import {eslint} from 'rollup-plugin-eslint'
16-
import {terser} from 'rollup-plugin-terser'
15+
import { eslint } from 'rollup-plugin-eslint'
16+
import { terser } from 'rollup-plugin-terser'
1717

1818
// Postcss plugins
19-
import simplevars from 'postcss-simple-vars'
20-
import nested from 'postcss-nested'
19+
// import simplevars from 'postcss-simple-vars'
20+
// import nested from 'postcss-nested'
2121
import postcssPresetEnv from 'postcss-preset-env'
2222

2323
// ef configuration
24-
import efConfig from './ef.config.js'
25-
const {
26-
efCoreModule,
27-
input,
28-
name,
29-
format,
30-
bundle,
31-
devPath,
32-
proPath,
33-
copyOptions,
34-
external,
35-
globals
36-
} = efConfig
24+
import efConfig from './ef.config.mjs'
25+
const { efCoreModule, input, name, format, bundle: _bundle, devPath: _devPath, proPath: _proPath, copyOptions, external, globals } = efConfig
3726

3827
console.log('Target:', chalk.bold.green(process.env.NODE_ENV || 'development'))
3928

29+
const production = process.env.NODE_ENV === 'production'
30+
4031
// Clear previous builds files
41-
if (process.env.NODE_ENV === 'production') del.sync([`${proPath}/**`])
42-
else del.sync([`${devPath}dev/**`])
32+
if (production) deleteSync([`${_proPath}/**`])
33+
else deleteSync([`${_devPath}/**`])
34+
35+
const bundle = path.normalize(_bundle)
36+
const devPath = path.normalize(_devPath)
37+
const proPath = path.normalize(_proPath)
4338

4439
export default {
4540
input,
@@ -48,14 +43,16 @@ export default {
4843
copyOptions,
4944
external,
5045
globals,
51-
bundle: path.normalize(bundle),
52-
devPath: path.normalize(devPath),
53-
proPath: path.normalize(proPath),
46+
bundle,
47+
devPath,
48+
proPath,
5449
plugins: [
5550
progress({
5651
clearLine: false
5752
}),
58-
eslint(),
53+
eslint({
54+
exclude: 'src/static/**.*'
55+
}),
5956
resolve({
6057
browser: true,
6158
extensions: ['.mjs', '.js', '.jsx', '.json', '.node']
@@ -67,15 +64,16 @@ export default {
6764
minimize: process.env.NODE_ENV === 'production',
6865
sourceMap: process.env.NODE_ENV !== 'production',
6966
plugins: [
70-
simplevars(),
71-
nested(),
67+
// simplevars(),
68+
// nested(),
7269
postcssPresetEnv({ warnForDuplicates: false })
7370
]
7471
}),
7572
buble({
7673
transforms: {
7774
modules: false,
78-
dangerousForOf: true
75+
dangerousForOf: true,
76+
asyncAwait: false
7977
},
8078
objectAssign: 'Object.assign',
8179
jsx: `${efCoreModule}.createElement`,
@@ -95,6 +93,6 @@ export default {
9593
'process.env.NODE_ENV': `'${process.env.NODE_ENV}'`
9694
}
9795
}),
98-
(process.env.NODE_ENV === 'production' && terser())
96+
process.env.NODE_ENV === 'production' && terser()
9997
]
10098
}

frameworks/non-keyed/ef-js/config/rollup.dev.js renamed to frameworks/keyed/ef-js/config/rollup.dev.mjs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Import plugins
22
import copy from 'rollup-plugin-copy-glob'
33
// Import base config
4-
import base from './rollup.base'
4+
import base from './rollup.base.mjs'
55
// Import browsersync config
6-
import bsConfig from './bs-config'
6+
import bsConfig from './bs-config.mjs'
77
// Import dev plugins
88
import browsersync from 'rollup-plugin-browsersync'
99

@@ -17,14 +17,12 @@ const config = {
1717
output: {
1818
name,
1919
format,
20-
file: `${devPath}/${bundle}.js`,
20+
file: format !== 'esm' && `${devPath}/${bundle}.js`,
21+
dir: format === 'esm' && devPath,
2122
sourcemap: true,
2223
globals
2324
},
24-
plugins: [
25-
copy(...copyOptions, {verbose: true, watch: true}),
26-
...plugins
27-
],
25+
plugins: [copy(...copyOptions, { verbose: true, watch: true }), ...plugins],
2826
watch: {
2927
include: ['src/**/*.*']
3028
}

frameworks/keyed/ef-js/config/rollup.prod.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)