Skip to content

Commit bf03d5a

Browse files
committed
fix: fix browser plugins
1 parent cb654f8 commit bf03d5a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/smooth/src/build/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ function getPluginFileContent(config) {
1515
.filter(plugin => plugin.browser)
1616
.map((plugin, index) => {
1717
const file = path.join(plugin.resolve, 'smooth-browser')
18-
return `{ plugin: '${file}', options: ${JSON.stringify(plugin.options)} }`
18+
return `{ plugin: require('${file}'), options: ${JSON.stringify(
19+
plugin.options,
20+
)} }`
1921
})
2022

2123
return `module.exports = [${definitions.join(',\n')}]`

packages/smooth/src/build/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('#buildBrowser', () => {
3636
const [[filename, content]] = cache.writeCacheFile.mock.calls
3737
expect(filename).toBe('browser-plugins.js')
3838
expect(content).toBe(
39-
'module.exports = [{ plugin: \'/a/smooth-browser\', options: {"foo":"bar"} }]',
39+
'module.exports = [{ plugin: require(\'/a/smooth-browser\'), options: {"foo":"bar"} }]',
4040
)
4141
})
4242
})

0 commit comments

Comments
 (0)