Skip to content

Commit

Permalink
feat: try module output
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyjosephprice committed Feb 27, 2024
1 parent ea27b21 commit 7ff2860
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions processor/transform/reusable-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const type = 'reusable-content';

const regexp = /^\s*<(?<tag>[A-Z]\S+)\s*\/>\s*$/;

const reusableContentTransformer = function () {
function reusableContentTransformer() {
const { tags, disabled } = this.data('reusableContent');
if (disabled) return () => undefined;

Expand All @@ -26,6 +26,6 @@ const reusableContentTransformer = function () {

return tree;
};
};
}

export default reusableContentTransformer;
13 changes: 8 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ const getConfig = ({ target }) => ({
optimization: {
minimize: false,
},
output: {
library: {
type: 'commonjs2',
},
},
resolve: {
extensions: ['.js', '.json', '.jsx', '.ts', '.tsx'],
},
Expand All @@ -100,6 +95,11 @@ const browserConfig = merge(getConfig({ target: 'web' }), {
umd: 'react-dom',
},
},
output: {
library: {
type: 'module',
},
},
resolve: {
fallback: {
buffer: require.resolve('buffer'),
Expand All @@ -112,6 +112,9 @@ const browserConfig = merge(getConfig({ target: 'web' }), {
const serverConfig = merge(getConfig({ target: 'node' }), {
output: {
filename: '[name].node.js',
library: {
type: 'commonjs2',
},
},
});

Expand Down

0 comments on commit 7ff2860

Please sign in to comment.