Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. apply(compiler) {
  2. this.config.servicePath = compiler.context;
  3. compiler.plugin('emit', (compilation, cb) => {
  4. this.service.load()
  5. .then((slsFileObjects) => {
  6. const parsedSlsYml = this.variables.populateService(slsFileObjects);
  7. const serviceConfig = _.get(parsedSlsYml, 'custom.serviceConfig');
  8. const props = { 'process.env.SERVICE_CONFIG': serviceConfig ? JSON.stringify(serviceConfig) : undefined };
  9. compiler.apply(new webpack.DefinePlugin(props));
  10. cb();
  11. });
  12. });
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement