2018-07-04 17:45:43 +00:00
/* eslint-env node */
2018-07-05 09:54:41 +00:00
const HTMLPlugin = require ( 'html-webpack-plugin' )
const CopyPlugin = require ( 'copy-webpack-plugin' )
2018-11-15 10:35:30 +00:00
const { EnvironmentPlugin } = require ( 'webpack' )
2018-07-04 17:45:43 +00:00
const path = require ( 'path' )
2018-10-08 15:10:39 +00:00
const { universal , web } = require ( './webpack.commonLoaders.js' )
2018-10-18 14:36:30 +00:00
2016-06-29 10:27:04 +00:00
module . exports = {
2017-05-10 14:09:36 +00:00
resolve : {
alias : {
Engine : path . resolve ( 'source/engine/' ) ,
2018-01-19 10:57:45 +00:00
Règles : path . resolve ( 'source/règles/' ) ,
2018-07-12 08:09:41 +00:00
Actions : path . resolve ( 'source/actions/' ) ,
Ui : path . resolve ( 'source/components/ui/' ) ,
2017-12-11 14:42:03 +00:00
Components : path . resolve ( 'source/components/' ) ,
2018-07-04 09:42:41 +00:00
Selectors : path . resolve ( 'source/selectors/' ) ,
2018-07-12 08:09:41 +00:00
Reducers : path . resolve ( 'source/reducers/' ) ,
2018-08-04 10:20:08 +00:00
Types : path . resolve ( 'source/types/' ) ,
Images : path . resolve ( 'source/images/' )
2017-05-10 14:09:36 +00:00
}
} ,
2018-07-12 08:09:41 +00:00
entry : {
2018-08-01 10:11:22 +00:00
embauche : [ './source/sites/embauche.gouv.fr/entry.js' ] ,
2018-11-20 14:39:00 +00:00
'mon-entreprise' : [ './source/sites/mycompanyinfrance.fr/entry.fr.js' ] ,
infrance : [ './source/sites/mycompanyinfrance.fr/entry.en.js' ] ,
2018-11-20 10:54:19 +00:00
2018-08-04 10:20:08 +00:00
// To not introduce breaking into the iframe integration, we serve simulateur.js from a 'dist' subdirectory
2018-10-21 17:06:04 +00:00
'dist/simulateur' : [ './source/sites/embauche.gouv.fr/iframe-script.js' ] ,
2018-07-12 08:09:41 +00:00
} ,
2018-03-01 18:39:36 +00:00
output : {
2018-11-13 10:57:45 +00:00
path : path . resolve ( './dist/' )
2018-03-01 18:39:36 +00:00
} ,
2016-06-29 10:27:04 +00:00
module : {
2018-10-08 15:10:39 +00:00
rules : [ ... web , ... universal ]
2018-07-04 17:45:43 +00:00
} ,
plugins : [
2018-11-15 10:35:30 +00:00
new EnvironmentPlugin ( {
2018-11-20 10:54:19 +00:00
EN _SITE : '/infrance${path}' ,
FR _SITE : '/mon-entreprise${path}'
} ) ,
2018-07-05 09:54:41 +00:00
new HTMLPlugin ( {
template : 'index.html' ,
2018-07-17 15:36:27 +00:00
chunks : [ 'infrance' ] ,
2018-10-26 15:44:33 +00:00
title :
'My company in France: A step-by-step guide to start a business in France' ,
2018-08-04 10:20:08 +00:00
description :
2018-09-19 16:37:22 +00:00
'Find the type of company that suits you and follow the steps to register your company. Discover the French social security system by simulating your hiring costs. Discover the procedures to hire in France and learn the basics of French labour law.' ,
2018-07-17 15:36:27 +00:00
filename : 'infrance.html'
2018-07-12 08:09:41 +00:00
} ) ,
new HTMLPlugin ( {
template : 'index.html' ,
2018-07-17 15:36:27 +00:00
chunks : [ 'embauche' ] ,
2018-08-04 10:20:08 +00:00
title : "Simulateur d'embauche 🤝" ,
description :
"Simulation du prix d'une embauche en France et calcul du salaire net à partir du brut : CDD, statut cadre, cotisations sociales, retraite..." ,
filename : 'embauche.html'
2018-07-05 09:54:41 +00:00
} ) ,
2018-11-13 15:47:49 +00:00
new HTMLPlugin ( {
template : 'index.html' ,
chunks : [ 'mon-entreprise' ] ,
title :
'Mon-entreprise : Un guide pas à pas pour créer une entreprise en France' ,
description :
'Du status juridique à premier embauche, vous trouverez ici toutes les ressources nécessaires pour démarrer votre activité.' ,
filename : 'mon-entreprise.html'
} ) ,
2019-01-08 18:20:51 +00:00
2018-08-04 10:20:08 +00:00
new CopyPlugin ( [
'./manifest.webmanifest' ,
'./source/sites/embauche.gouv.fr/images/logo' ,
2018-10-26 15:44:33 +00:00
{
from : './source/sites/embauche.gouv.fr/robots.txt' ,
to : 'robots.embauche.txt'
} ,
{
from : './source/sites/mycompanyinfrance.fr/robots.txt' ,
to : 'robots.infrance.txt'
} ,
{
2018-11-13 15:47:49 +00:00
from : './source/sites/mycompanyinfrance.fr/sitemap.fr.txt' ,
to : 'sitemap.infrance.fr.txt'
} ,
2018-11-20 10:54:19 +00:00
2018-11-13 15:47:49 +00:00
{
from : './source/sites/mycompanyinfrance.fr/sitemap.en.txt' ,
to : 'sitemap.infrance.en.txt'
2018-10-26 15:44:33 +00:00
}
2018-11-20 10:54:19 +00:00
] )
2018-07-04 17:45:43 +00:00
]
2016-06-29 10:27:04 +00:00
}