Nouvelle cible webpack 'engine'

pull/386/head
Mael 2018-08-15 11:39:10 +02:00
parent b4bd491861
commit d072ea0e3f
4 changed files with 50 additions and 3 deletions

2
.gitignore vendored
View File

@ -7,4 +7,4 @@ package-lock.json
yarn-error.log
flow-typed/
cypress/videos
cypress/screenshots
cypress/screenshots

39
dist/engine.js vendored Normal file

File diff suppressed because one or more lines are too long

3
source/engine/index.js Normal file
View File

@ -0,0 +1,3 @@
import { analyseMany } from './traverse.js'
export default analyseMany

View File

@ -24,12 +24,17 @@ module.exports = {
embauche: ['./source/sites/embauche.gouv.fr/entry.js'],
// To not introduce breaking into the iframe integration, we serve simulateur.js from a 'dist' subdirectory
'dist/simulateur': ['./source/sites/embauche.gouv.fr/iframe-script.js']
'dist/simulateur': ['./source/sites/embauche.gouv.fr/iframe-script.js'],
engine: ['./source/engine/index.js']
},
output: {
path: path.resolve('./dist/'),
filename: ({ chunk }) =>
chunk.name === 'dist/simulateur' ? '[name].js' : '[name].[hash].js'
['dist/simulateur', 'engine'].includes(chunk.name)
? '[name].js'
: '[name].[hash].js',
libraryTarget: 'umd',
library: 'Syso'
},
module: {
rules: [