-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tsup configuration for vanilla Webpack 4 without
babel-loader
(#…
…5322) * Update barrel files * Emit CJS as ES2019 * Force code splitting in CJS * Add entry
- Loading branch information
Showing
15 changed files
with
118 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// This is required for Webpack 4 which does not support named exports. | ||
// eslint-disable-next-line no-undef | ||
module.exports = require('./dist/botframework-webchat-api.decorator'); | ||
module.exports = require('./dist/botframework-webchat-api.decorator.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// This is required for Webpack 4 which does not support named exports. | ||
// eslint-disable-next-line no-undef | ||
module.exports = require('./dist/botframework-webchat-api.internal'); | ||
module.exports = require('./dist/botframework-webchat-api.internal.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
import { defineConfig } from 'tsup'; | ||
import baseConfig from '../../tsup.base.config'; | ||
|
||
export default defineConfig({ | ||
const config: typeof baseConfig = { | ||
...baseConfig, | ||
entry: { | ||
'botframework-webchat-api': './src/index.ts', | ||
'botframework-webchat-api.internal': './src/internal.ts', | ||
'botframework-webchat-api.decorator': './src/decorator/index.ts' | ||
} | ||
}; | ||
|
||
export default defineConfig([ | ||
{ | ||
...config, | ||
format: 'esm', | ||
noExternal: ['globalize'] | ||
}, | ||
noExternal: ['globalize'], | ||
format: ['esm', 'cjs'] | ||
}); | ||
{ | ||
...config, | ||
format: 'cjs', | ||
target: [...config.target, 'es2019'] | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
import { defineConfig } from 'tsup'; | ||
import baseConfig from '../../tsup.base.config'; | ||
|
||
export default defineConfig({ | ||
const config: typeof baseConfig = { | ||
...baseConfig, | ||
entry: { | ||
'botframework-webchat-base': './src/index.ts', | ||
'botframework-webchat-base.utils': './src/utils/index.ts' | ||
} | ||
}; | ||
|
||
export default defineConfig([ | ||
{ | ||
...config, | ||
format: 'esm' | ||
}, | ||
format: ['esm', 'cjs'] | ||
}); | ||
{ | ||
...config, | ||
format: 'cjs', | ||
target: [...config.target, 'es2019'] | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// This is required for Webpack 4 which does not support named exports. | ||
// eslint-disable-next-line no-undef | ||
module.exports = require('./dist/botframework-webchat-base.utils'); | ||
module.exports = require('./dist/botframework-webchat-base.utils.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// This is required for Webpack 4 which does not support named exports. | ||
// eslint-disable-next-line no-undef | ||
module.exports = require('./lib/decorator/index'); | ||
module.exports = require('./dist/botframework-webchat-component.decorator.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// This is required for Webpack 4 which does not support named exports. | ||
// eslint-disable-next-line no-undef | ||
module.exports = require('./lib/internal'); | ||
module.exports = require('./dist/botframework-webchat-component.internal.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
import { defineConfig } from 'tsup'; | ||
import baseConfig from '../../tsup.base.config'; | ||
|
||
export default defineConfig({ | ||
const config: typeof baseConfig = { | ||
...baseConfig, | ||
entry: { | ||
'botframework-webchat-core': './src/index.ts' | ||
} | ||
}; | ||
|
||
export default defineConfig([ | ||
{ | ||
...config, | ||
format: 'esm' | ||
}, | ||
format: ['esm', 'cjs'] | ||
}); | ||
{ | ||
...config, | ||
format: 'cjs', | ||
target: [...config.target, 'es2019'] | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
import { defineConfig } from 'tsup'; | ||
import baseConfig from '../../tsup.base.config'; | ||
|
||
export default defineConfig({ | ||
const config: typeof baseConfig = { | ||
...baseConfig, | ||
entry: { | ||
'botframework-webchat-styles': './src/index.ts', | ||
'botframework-webchat-styles.build': './src/build/index.ts', | ||
'botframework-webchat-styles.react': './src/react/index.ts' | ||
} | ||
}; | ||
|
||
export default defineConfig([ | ||
{ | ||
...config, | ||
format: 'esm' | ||
}, | ||
format: ['esm', 'cjs'] | ||
}); | ||
{ | ||
...config, | ||
format: 'cjs', | ||
target: [...config.target, 'es2019'] | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters