Eleventy: Passthrough on Different Environment Variables?

Created on 13 May 2020  路  2Comments  路  Source: 11ty/eleventy

In .eleventy.js I have the following line: eleventyConfig.addPassthroughCopy('./src/styles.css'); and the styles file is passed through just fine (as expected).

Is it possible to disable the passthrough of that particular file on production via ELEVENTY_ENV=production?

education

Most helpful comment

Oh wait, this worked:

  if (process.myProject.ELEVENTY_ENV != 'production') {
    eleventyConfig.addPassthroughCopy('./src/styles.css');
  }

All 2 comments

Oh wait, this worked:

  if (process.myProject.ELEVENTY_ENV != 'production') {
    eleventyConfig.addPassthroughCopy('./src/styles.css');
  }

@huphtur Please close the issue if you see fit. Looks like it's solved! :)

Was this page helpful?
0 / 5 - 0 ratings