Skip to content

Commit fa030e2

Browse files
committed
fix(build): no longer publishing "module" either
Giving up on this: there isn't a great reason to publish modules here as they won't be significantly tree-shook, and it bloats the published package. Fixes incompatiblity in 4.4.0 with webpack, where webpack is now selecting "module" because "browser" is no longer present.
1 parent 75d75d7 commit fa030e2

File tree

4 files changed

+1
-18
lines changed

4 files changed

+1
-18
lines changed

.babelrc.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
'use strict';
22

3-
// If set, we put Babel in "esmMode", i.e. leave import/export intact.
4-
// Good for webpack and for an esm build.
5-
const esmMode = process.env.BABEL_MODULE_TYPE === "module";
6-
const es6Compat = process.env.BABEL_ES_COMPAT === "6";
7-
83
module.exports = {
94
"presets": [
105
[
116
"@babel/preset-env",
127
{
13-
// Don't transpile import/export in esmMode.
14-
modules: esmMode ? false : "auto",
15-
targets: es6Compat ? "maintained node versions" : undefined
8+
targets: "> 0.25%, not dead"
169
},
1710
],
1811
"@babel/react",

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ build: clean build-cjs build-esm build-web
2121
build-cjs: $(BIN)
2222
$(BIN)/babel --out-dir ./build/cjs ./lib
2323

24-
build-esm: $(BIN)
25-
env BABEL_MODULE_TYPE="module" BABEL_ES_COMPAT="6" $(BIN)/babel --out-dir ./build/module ./lib
26-
2724
build-web: $(BIN)
2825
$(BIN)/webpack --mode=production --display-modules
2926

karma-phantomjs.conf.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22

33
const baseConfig = require('./karma.conf.js');
4-
// Phantom build can't handle the modern JS in the module build
5-
process.env.BABEL_MODULE_TYPE = 'cjs';
64

75
module.exports = function(config) {
86
// Set base config options.

webpack.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
const path = require('path');
22
const webpack = require('webpack');
33

4-
// Grabbed in .babelrc.js to switch on transpiling modules.
5-
// We want webpack to handle modules if possible.
6-
// This can be overridden and webpack will handle babelified CJS.
7-
process.env.BABEL_MODULE_TYPE = process.env.BABEL_MODULE_TYPE || 'module';
8-
94
module.exports = (env, argv) => ({
105
entry: {
116
'react-draggable.min': './lib/cjs.js',

0 commit comments

Comments
 (0)