Skip to content

Commit a9154f0

Browse files
committed
Update to microbundle v0.10.1, use the alias option to set MINI
1 parent fac9149 commit a9154f0

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"module": "dist/htm.mjs",
88
"scripts": {
99
"build": "npm run -s build:main && npm run -s build:mini && npm run -s build:preact && npm run -s build:babel && npm run -s build:babel-transform-jsx",
10-
"build:main": "microbundle src/index.mjs -f es,umd --no-sourcemap --target web --define HTM_MODE=default && microbundle src/cjs.mjs -f iife --no-sourcemap --target web --define HTM_MODE=default",
11-
"build:mini": "microbundle src/index.mjs -o ./mini/index.js -f es,umd --no-sourcemap --target web --define HTM_MODE=mini && microbundle src/cjs.mjs -o ./mini/index.js -f iife --no-sourcemap --target web --define HTM_MODE=mini",
10+
"build:main": "microbundle src/index.mjs -f es,umd --no-sourcemap --target web && microbundle src/cjs.mjs -f iife --no-sourcemap --target web",
11+
"build:mini": "microbundle src/index.mjs -o ./mini/index.js -f es,umd --no-sourcemap --target web --alias ./constants=./constants-mini && microbundle src/cjs.mjs -o ./mini/index.js -f iife --no-sourcemap --target web --alias ./constants=./constants-mini",
1212
"build:preact": "cd src/integrations/preact && npm run build",
1313
"build:babel": "cd packages/babel-plugin-htm && npm run build",
1414
"build:babel-transform-jsx": "cd packages/babel-plugin-transform-jsx-to-htm && npm run build",
@@ -73,7 +73,7 @@
7373
"eslint": "^5.2.0",
7474
"eslint-config-developit": "^1.1.1",
7575
"jest": "^24.1.0",
76-
"microbundle": "^0.10.0",
76+
"microbundle": "^0.10.1",
7777
"preact": "^8.4.2"
7878
},
7979
"dependencies": {},

packages/babel-plugin-htm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
"htm": "^2.0.0"
3333
},
3434
"devDependencies": {
35-
"microbundle": "^0.10.0"
35+
"microbundle": "^0.10.1"
3636
}
3737
}

packages/babel-plugin-transform-jsx-to-htm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
"license": "Apache-2.0",
2929
"homepage": "https://github.com/developit/htm/tree/master/packages/babel-plugin-transform-jsx-to-htm",
3030
"devDependencies": {
31-
"microbundle": "^0.10.0"
31+
"microbundle": "^0.10.1"
3232
}
3333
}

src/constants-mini.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const MINI = true;

src/constants.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const MINI = false;

src/index.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
* limitations under the License.
1212
*/
1313

14-
/* globals HTM_MODE */
15-
const MINI = typeof HTM_MODE === 'string' && HTM_MODE === 'mini';
14+
import { MINI } from './constants';
1615

1716
const TAG_SET = 1;
1817
const PROPS_SET = 2;
@@ -207,7 +206,7 @@ const getCacheKeyed = (statics) => {
207206
return CACHE[key] || (CACHE[key] = build(statics));
208207
};
209208

210-
const USE_MAP = !MINI && typeof Map === 'function';
209+
const USE_MAP = typeof Map === 'function';
211210
const CACHE = USE_MAP ? new Map() : {};
212211
const getCache = USE_MAP ? getCacheMap : getCacheKeyed;
213212

0 commit comments

Comments
 (0)