mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
build: tweak webpack config to resolve exports field in package.json
This commit is contained in:
parent
d36a94ffff
commit
5dbd1a1ff6
1 changed files with 21 additions and 2 deletions
|
|
@ -99,6 +99,7 @@ module.exports = {
|
|||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
|
||||
modules: [srcPath, packagesPath, 'node_modules'],
|
||||
mainFields: ['main', 'exports'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
|
@ -113,10 +114,28 @@ module.exports = {
|
|||
sideEffects: false,
|
||||
},
|
||||
{
|
||||
test: /\.m?js$/,
|
||||
test: /\.[cm]?js$/,
|
||||
loader: 'babel-loader',
|
||||
// Transpile as least files under node_modules
|
||||
include: /node_modules\/(webext-content-scripts|webext-detect-page|superstruct)\/.*\.m?js$/,
|
||||
include: new RegExp(
|
||||
[
|
||||
``,
|
||||
`node_modules`,
|
||||
`(${[
|
||||
`superstruct`,
|
||||
`webext-alert`,
|
||||
`webext-content-scripts`,
|
||||
`webext-detect-page`,
|
||||
`webext-detect`,
|
||||
`webext-dynamic-content-scripts`,
|
||||
`webext-events`,
|
||||
`webext-permission-toggle`,
|
||||
`webext-permissions`,
|
||||
`webext-tools`,
|
||||
].join('|')})`,
|
||||
``,
|
||||
].join('/'),
|
||||
),
|
||||
options: {
|
||||
cacheDirectory: true,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue