diff --git a/processor/transform/reusable-content.js b/processor/transform/reusable-content.js index ba1fea8a8..7cc3195c8 100644 --- a/processor/transform/reusable-content.js +++ b/processor/transform/reusable-content.js @@ -4,7 +4,7 @@ export const type = 'reusable-content'; const regexp = /^\s*<(?[A-Z]\S+)\s*\/>\s*$/; -function reusableContentTransformer() { +const reusableContentTransformer = function () { const { tags, disabled } = this.data('reusableContent'); if (disabled) return () => undefined; @@ -26,6 +26,6 @@ function reusableContentTransformer() { return tree; }; -} +}; export default reusableContentTransformer; diff --git a/webpack.config.js b/webpack.config.js index 4fe26f0b3..6d05f4843 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -71,6 +71,11 @@ const getConfig = ({ target }) => ({ optimization: { minimize: false, }, + output: { + library: { + type: 'commonjs2', + }, + }, resolve: { extensions: ['.js', '.json', '.jsx', '.ts', '.tsx'], }, @@ -95,11 +100,6 @@ const browserConfig = merge(getConfig({ target: 'web' }), { umd: 'react-dom', }, }, - output: { - library: { - type: 'module', - }, - }, resolve: { fallback: { buffer: require.resolve('buffer'), @@ -112,9 +112,6 @@ const browserConfig = merge(getConfig({ target: 'web' }), { const serverConfig = merge(getConfig({ target: 'node' }), { output: { filename: '[name].node.js', - library: { - type: 'commonjs2', - }, }, });