diff --git a/src/sources/govukTemplate.js b/src/sources/govukTemplate.js index 15f0b49..0174580 100644 --- a/src/sources/govukTemplate.js +++ b/src/sources/govukTemplate.js @@ -1,8 +1,8 @@ const path = require('path'); const CopyWebpackPlugin = require('copy-webpack-plugin'); -// Walk the tree to get back to the root of the module -const root = path.resolve(require.resolve('govuk_template_jinja'), '../../../'); +const packageJson = require.resolve('govuk_template_jinja/package.json'); +const root = path.resolve(packageJson, '..'); const templates = path.resolve(root, 'views'); const assets = path.resolve(root, 'assets'); @@ -19,4 +19,4 @@ const copyGovukTemplateAssets = new CopyWebpackPlugin([ module.exports = { paths: { root, templates, assets, images, javascripts, stylesheets }, plugins: [ copyGovukTemplateAssets ] -}; \ No newline at end of file +};