mirror of
https://github.com/desktop/desktop
synced 2024-10-02 14:23:59 +00:00
🔥 webpack hack too skip file-metadata on Windows
This commit is contained in:
parent
074afe84c7
commit
ef849b0bde
|
@ -62,41 +62,17 @@ const commonConfig: webpack.Configuration = {
|
|||
},
|
||||
}
|
||||
|
||||
// Hack: The file-metadata plugin has substantial dependencies
|
||||
// (plist, DOMParser, etc) and it's only applicable on macOS.
|
||||
//
|
||||
// Therefore, when compiling on other platforms, we replace it
|
||||
// with a tiny shim instead.
|
||||
const shimFileMetadata = {
|
||||
resolve: {
|
||||
alias: {
|
||||
'file-metadata': path.resolve(
|
||||
__dirname,
|
||||
'src',
|
||||
'lib',
|
||||
'helpers',
|
||||
'file-metadata.js'
|
||||
),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export const main = merge(
|
||||
{},
|
||||
commonConfig,
|
||||
{
|
||||
entry: { main: path.resolve(__dirname, 'src/main-process/main') },
|
||||
target: 'electron-main',
|
||||
plugins: [
|
||||
new webpack.DefinePlugin(
|
||||
Object.assign({}, replacements, {
|
||||
__PROCESS_KIND__: JSON.stringify('main'),
|
||||
})
|
||||
),
|
||||
],
|
||||
},
|
||||
process.platform !== 'darwin' ? shimFileMetadata : {}
|
||||
)
|
||||
export const main = merge({}, commonConfig, {
|
||||
entry: { main: path.resolve(__dirname, 'src/main-process/main') },
|
||||
target: 'electron-main',
|
||||
plugins: [
|
||||
new webpack.DefinePlugin(
|
||||
Object.assign({}, replacements, {
|
||||
__PROCESS_KIND__: JSON.stringify('main'),
|
||||
})
|
||||
),
|
||||
],
|
||||
})
|
||||
|
||||
export const renderer = merge({}, commonConfig, {
|
||||
entry: { renderer: path.resolve(__dirname, 'src/ui/index') },
|
||||
|
|
Loading…
Reference in a new issue