Skip to content

Commit a8299b5

Browse files
committed
improved configs and type
1 parent 6b04155 commit a8299b5

File tree

8 files changed

+104
-125
lines changed

8 files changed

+104
-125
lines changed

babel.config.js

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

babel.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default {
2+
presets: [
3+
['@babel/preset-env', {
4+
targets: {
5+
browsers: ['> 1%', 'last 3 versions', 'not dead']
6+
}
7+
}],
8+
'@babel/preset-typescript'
9+
]
10+
}

jest.config.js renamed to jest.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
},
1010
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
1111
transform: {
12-
'^.+\\.[tj]sx?$': ['babel-jest', { configFile: './babel.config.js' }],
12+
'^.+\\.[tj]sx?$': ['babel-jest', { configFile: './babel.config.mjs' }],
1313
},
1414
setupFilesAfterEnv: ['./test/helpers/setup.ts'],
1515
testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "solid-logic",
33
"version": "3.1.1",
44
"description": "Core business logic of SolidOS",
5+
"type": "module",
56
"main": "dist/solid-logic.js",
67
"module": "dist/solid-logic.esm.js",
78
"types": "dist/index.d.ts",

test/testBundles/test-umd.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
<body>
88
<h1>Solid Logic UMD Bundle Browser Test</h1>
99
<pre id="output"></pre>
10-
<script type="module">
11-
import * as $rdf from 'https://esm.sh/rdflib'
12-
import { someFunction } from 'https://esm.sh/solid-logic'
13-
14-
// Example usage
15-
// someFunction(...)
16-
</script>
17-
<!-- Load rdflib dependency -->
18-
<script src="https://cdn.jsdelivr.net/npm/rdflib/dist/rdflib.min.js"></script>
19-
2010
<!--- !!!--- first build dist with npm run build-dist ---!!! -->
2111
<!-- Load solid-logic UMD bundle (adjust path if needed) -->
2212
<script src="../../dist/solid-logic.js"></script>

tsconfig.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"compilerOptions": {
33
/* Basic Options */
4-
"target": "ES2022", /* Allow top-level await and modern JS features. */
5-
"module": "CommonJS", /* Use ESNext modules for Webpack/Babel compatibility. */
4+
"target": "ES2019" /* Specify ECMAScript target version - matches your browser support */,
5+
"module": "ESNext" /* Let bundlers handle module transformation for better tree-shaking */,
66
"moduleResolution": "node", /* Use Node.js-style module resolution for Webpack compatibility. */
77
"lib": [
8-
"dom",
9-
"es2015",
10-
"es2019"
8+
"DOM",
9+
"ES2019"
1110
] /* Specify library files to be included in the compilation. */,
1211
// "allowJs": true, /* Allow javascript files to be compiled. */
1312
// "checkJs": true, /* Report errors in .js files. */

webpack.config.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ export default [
3939
filename: 'solid-logic.js',
4040
library: {
4141
name: 'SolidLogic',
42-
type: 'umd'
42+
type: 'umd',
43+
umdNamedDefine: true
4344
},
4445
globalObject: 'this',
45-
iife: true,
4646
clean: false
4747
},
4848
externals: externalsBase,
@@ -58,10 +58,10 @@ export default [
5858
filename: 'solid-logic.min.js',
5959
library: {
6060
name: 'SolidLogic',
61-
type: 'umd'
61+
type: 'umd',
62+
umdNamedDefine: true
6263
},
6364
globalObject: 'this',
64-
iife: true,
6565
clean: false
6666
},
6767
externals: externalsBase,

0 commit comments

Comments
 (0)