Skip to content

Commit

Permalink
fix(build/publicPage): copy iconPath to public directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Crash-- committed Dec 28, 2018
1 parent e0af5b0 commit c50befd
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 9 deletions.
20 changes: 15 additions & 5 deletions app.config.js
Expand Up @@ -8,24 +8,34 @@ const configurationFiles = []

configurationFiles.push(require('cozy-scripts/config/webpack.bundle.preact.js'))

configurationFiles.push(require('cozy-scripts/config/webpack.config.css-modules'))
configurationFiles.push(
require('cozy-scripts/config/webpack.config.css-modules')
)

const isDrive = process.env.COZY_APP_SLUG === 'drive'
const isPhotosServices = process.env.COZY_APP_SLUG === 'photos:services'

if (isDrive) configurationFiles.push(require('./webpack/drive.config.js'))
else if (isPhotosServices) {
configurationFiles.push(require('cozy-scripts/config/webpack.config.services'))
configurationFiles.push(
require('cozy-scripts/config/webpack.config.services')
)
const nodeExternals = require('webpack-node-externals')
configurationFiles.push({ externals: [nodeExternals()] })
}
if (isDrive && target === 'mobile') configurationFiles.push(require('./webpack/mobile.config.js'))

if (isDrive && target === 'mobile')
configurationFiles.push(require('./webpack/mobile.config.js'))
if (target !== 'mobile')
configurationFiles.push(require('./webpack/appicon.config.js'))
const extraConfig = {
resolve: {
modules: ['node_modules', SRC_DIR],
alias: {
'react-cozy-helpers': path.resolve(SRC_DIR, './lib/react-cozy-helpers'),
'create-react-class': path.resolve('node_modules', 'preact-compat/lib/create-react-class')
'create-react-class': path.resolve(
'node_modules',
'preact-compat/lib/create-react-class'
)
}
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion src/drive/targets/manifest.webapp
Expand Up @@ -5,7 +5,7 @@
"version": "1.14.1",
"type": "webapp",
"licence": "AGPL-3.0",
"icon": "app-icon.svg",
"icon": "public/app-icon.svg",
"categories": ["cozy"],
"source": "https://github.com/cozy/cozy-drive",
"editor": "Cozy",
Expand Down
2 changes: 1 addition & 1 deletion src/photos/targets/manifest.webapp
Expand Up @@ -5,7 +5,7 @@
"version": "1.14.1",
"type": "webapp",
"licence": "AGPL-3.0",
"icon": "app-icon.svg",
"icon": "public/app-icon.svg",
"categories": ["cozy"],
"source": "https://github.com/cozy/cozy-drive",
"editor": "Cozy",
Expand Down
15 changes: 15 additions & 0 deletions webpack/appicon.config.js
@@ -0,0 +1,15 @@
const CopyPlugin = require('copy-webpack-plugin')
const isDrive = process.env.COZY_APP_SLUG === 'drive'

const app = isDrive ? 'drive' : 'photos'
module.exports = {
plugins: [
new CopyPlugin([
{
from: `src/${app}/targets/vendor/assets/app-icon.svg`,
to: 'public/app-icon.svg'
},
{ from: `src/${app}/targets/vendor/assets`, ignore: ['.gitkeep'] }
])
]
}
3 changes: 1 addition & 2 deletions webpack/drive.config.js
@@ -1,4 +1,3 @@
const path = require('path')
const { DefinePlugin } = require('webpack')

module.exports = {
Expand All @@ -9,6 +8,6 @@ module.exports = {
__SENTRY_URL__: JSON.stringify(
'https://29bd1255b6d544a1b65435a634c9ff67@sentry.cozycloud.cc/2'
)
}),
})
]
}

0 comments on commit c50befd

Please sign in to comment.