Skip to content

Commit

Permalink
Use cleaner way to resolve to the repo root
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldfallen committed Aug 14, 2017
1 parent 4088264 commit e7b51ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sources/govukTemplate.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -19,4 +19,4 @@ const copyGovukTemplateAssets = new CopyWebpackPlugin([
module.exports = {
paths: { root, templates, assets, images, javascripts, stylesheets },
plugins: [ copyGovukTemplateAssets ]
};
};

0 comments on commit e7b51ab

Please sign in to comment.