first commit
This commit is contained in:
30
themes/ayon_/_dev/_webpack/util.js
Normal file
30
themes/ayon_/_dev/_webpack/util.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const mapObject = obj => fn => Object.keys(obj).map(key => fn(obj[key], key));
|
||||
|
||||
module.exports = {
|
||||
browserSyncPort: 3000, // The port on which the server browserSync will be launched
|
||||
browserSyncOpen: true, // Auto open browserSync URL in browser
|
||||
browserSyncTarget: "https://ayon.dev/", // URL of your server prestashop (example: "http://localhost:8080/ps/" or "http://remote-server.com")
|
||||
themeFolderName: 'ayon', // folder name your theme
|
||||
|
||||
outputFolderName: 'assets/js',
|
||||
get publicPath(){
|
||||
return `https://localhost:${this.browserSyncPort}/themes/${this.themeFolderName}/${this.outputFolderName}/`;
|
||||
// check public path to 'outputFolderName'
|
||||
// if you use next 'browserSyncTarget'
|
||||
// browserSyncTarget: "http://localhost:8080/ps/"
|
||||
// That publicPath will be such
|
||||
// `http://localhost:${this.browserSyncPort}/ps/themes/${this.themeFolderName}/${this.outputFolderName}/`
|
||||
},
|
||||
DEV: process.env.NODE_ENV !== "production",
|
||||
|
||||
addHotMiddleware(entry) {
|
||||
const newEntry = {};
|
||||
|
||||
mapObject(entry)((val, name) => {
|
||||
val = (Array.isArray(val) ? val : [val]).slice();
|
||||
val.unshift("webpack/hot/dev-server", "webpack-hot-middleware/client");
|
||||
newEntry[name] = val;
|
||||
});
|
||||
return newEntry;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user