Skip to content

Commit 42c57e3

Browse files
committed
Expose ES6 module.
1 parent 0942d2d commit 42c57e3

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

.babelrc

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
{
22
presets: [
3-
["@babel/env"],
3+
["@babel/preset-env"],
44
],
55
plugins: [
6-
["@babel/plugin-proposal-class-properties"],
6+
["@babel/plugin-proposal-class-properties", { loose: true }],
77
["babel-plugin-inline-import", {
88
extensions: [
99
".ttl",
1010
".sparql",
1111
],
1212
}],
1313
],
14+
15+
env: {
16+
module: {
17+
presets: [
18+
["@babel/preset-env", { modules: false }],
19+
],
20+
},
21+
},
1422
}

.browserslistrc

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Build for Node
2-
node 8
2+
node >=10
3+
34
# Build for most browsers
4-
> 1%
5+
>2%
6+
last 2 Chrome versions
7+
last 2 Firefox versions
8+
last 2 iOS versions
59

6-
# No Proxy support
10+
# Drop browsers without Proxy support
711
not ie <= 11
812
not operamini all

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
coverage
22
dist
33
lib
4+
module
45
node_modules

package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@
99
"url": "https://github.com/solid/query-ldflex/"
1010
},
1111
"main": "lib/index.js",
12+
"module": "module/index.js",
13+
"sideEffects": false,
1214
"files": [
1315
"src",
1416
"lib",
17+
"module",
1518
"dist",
16-
"!dist/demo"
19+
"!dist/demo",
20+
".babelrc"
1721
],
1822
"dependencies": {
1923
"@rdfjs/data-model": "^1.1.1",
@@ -42,10 +46,11 @@
4246
"webpack-dev-server": "^3.1.14"
4347
},
4448
"scripts": {
45-
"build": "npm run build:lib && npm run build:dist && npm run build:demo",
49+
"build": "npm run build:lib && npm run build:module && npm run build:dist && npm run build:demo",
4650
"build:demo": "webpack --config=./webpack/webpack.demo.config.js",
4751
"build:dist": "webpack --mode=production --config=./webpack/webpack.lib.config.js",
4852
"build:lib": "babel src --out-dir lib --copy-files",
53+
"build:module": "BABEL_ENV=module babel src --out-dir module",
4954
"jest": "jest",
5055
"lint": "eslint src test demo webpack",
5156
"precommit": "npm test",

0 commit comments

Comments
 (0)