forked from ezsystems/ezplatform
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
15 changed files
with
129 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ services: | |
- docker | ||
|
||
cache: | ||
yarn: true | ||
directories: | ||
- $HOME/.composer/cache/files | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const path = require('path'); | ||
const bundles = require('./var/encore/ez.config.js'); | ||
|
||
module.exports = (Encore) => { | ||
Encore.setOutputPath('web/assets/ezplatform/build') | ||
.setPublicPath('/assets/ezplatform/build') | ||
.addExternals({ | ||
react: 'React', | ||
'react-dom': 'ReactDOM', | ||
jquery: 'jQuery', | ||
moment: 'moment', | ||
'popper.js': 'Popper', | ||
alloyeditor: 'AlloyEditor', | ||
'prop-types': 'PropTypes', | ||
}) | ||
.enableSassLoader() | ||
.enableReactPreset() | ||
.enableSingleRuntimeChunk(); | ||
|
||
bundles.forEach((configPath) => { | ||
const addEntries = require(configPath); | ||
|
||
addEntries(Encore); | ||
}); | ||
|
||
const eZConfig = Encore.getWebpackConfig(); | ||
|
||
eZConfig.name = 'ezplatform'; | ||
|
||
return eZConfig; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const findItems = (eZConfig, entryName) => { | ||
const items = eZConfig.entry[entryName]; | ||
|
||
if (!items) { | ||
throw new Error(`Couldn't find entry with name: "${entryName}". Please check if there is a typo in the name.`); | ||
} | ||
|
||
return items; | ||
}; | ||
const replace = ({ eZConfig, entryName, itemToReplace, newItem }) => { | ||
const items = findItems(eZConfig, entryName); | ||
const indexToReplace = items.indexOf(itemToReplace); | ||
|
||
if (indexToReplace < 0) { | ||
throw new Error(`Couldn't find item "${itemToReplace}" in entry "${entryName}". Please check if there is a typo in the name.`); | ||
} | ||
|
||
items[indexToReplace] = newItem; | ||
}; | ||
const remove = ({ eZConfig, entryName, itemsToRemove }) => { | ||
const items = findItems(eZConfig, entryName); | ||
|
||
eZConfig.entry[entryName] = items.filter((item) => !itemsToRemove.includes(item)); | ||
}; | ||
const add = ({ eZConfig, entryName, newItems }) => { | ||
const items = findItems(eZConfig, entryName); | ||
|
||
eZConfig.entry[entryName] = [...items, ...newItems]; | ||
}; | ||
|
||
module.exports = { | ||
replace, | ||
remove, | ||
add | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"devDependencies": { | ||
"@babel/preset-react": "^7.0.0", | ||
"@symfony/webpack-encore": "^0.22.4", | ||
"node-sass": "^4.11.0", | ||
"sass-loader": "^7.0.1" | ||
} | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const Encore = require('@symfony/webpack-encore'); | ||
const path = require('path'); | ||
const getEzConfig = require('./ez.webpack.config.js'); | ||
const eZConfigManager = require('./ez.webpack.config.manager.js'); | ||
const eZConfig = getEzConfig(Encore); | ||
|
||
Encore.reset(); | ||
Encore.setOutputPath('web/assets/build') | ||
.setPublicPath('/assets/build') | ||
.enableSassLoader() | ||
.enableReactPreset() | ||
.enableSingleRuntimeChunk(); | ||
|
||
// Put your config here. | ||
|
||
// uncomment the two lines below, if you have your own Encore configuration for your project | ||
// const projectConfig = Encore.getWebpackConfig(); | ||
// module.exports = [ eZConfig, projectConfig ]; | ||
|
||
// comment-out this line if you've uncommented the above lines | ||
module.exports = eZConfig; |