Skip to content

Commit

Permalink
Use iframe-resizer via npm
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ju committed Jan 10, 2018
1 parent d9562c9 commit 921fbb2
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 28 deletions.
4 changes: 3 additions & 1 deletion config/paths.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"config": "config/",
"deploy": "deploy",
"public": "deploy/public/",
"govukfrontend": "node_modules/@govuk-frontend/",
"nodemodules": "node_modules/",
"govukfrontend": "node_modules/@govuk-frontend/",
"iframeresizer": "node_modules/iframe-resizer/",
"source": "src/",
"components": "src/components/",
"images": "src/images/",
Expand Down
12 changes: 9 additions & 3 deletions lib/metalsmith.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,24 @@ module.exports = metalsmith(__dirname) // __dirname defined by node.js: name of
includePaths: ['node_modules'] // an array of paths that sass can look in when attempt to resolve @import declarations
}))

// copy static assets from node_modules
// copy static assets from node_modules/@govukfrontend
.use(assets({
source: '../' + paths.govukfrontend + 'icons/',
destination: 'icons'
}))

// copy static assets from node_modules/iframe-resizer
.use(assets({
source: '../' + paths.iframeresizer + 'js/',
destination: 'javascripts/vendor'
}))

// concatenate javascript files
.use(concat({
files: [
'javascripts/vendor/jquery.js',
'javascripts/vendor/clipboard.js',
'javascripts/vendor/iframeResizer.js',
'javascripts/vendor/iframeResizer.min.js',
'javascripts/components/example.js',
'javascripts/components/tabs.js',
'javascripts/components/copy.js',
Expand All @@ -68,7 +74,7 @@ module.exports = metalsmith(__dirname) // __dirname defined by node.js: name of
.use(concat({
files: [
'javascripts/vendor/html5shiv-printshiv.js',
'javascripts/vendor/iframeResizer.ie8.polyfils.js',
'javascripts/vendor/ie8.polyfils.min.js',
'javascripts/ie-only.js'
],
output: 'javascripts/ie.js'
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"devDependencies": {
"gulp": "^3.9.1",
"gulp-sass-lint": "^1.3.4",
"iframe-resizer": "^3.5.15",
"jstransformer-markdown": "^1.2.1",
"jstransformer-nunjucks": "^0.5.0",
"metalsmith": "^2.3.0",
Expand Down
10 changes: 0 additions & 10 deletions src/javascripts/vendor/iframeResizer.contentWindow.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/javascripts/vendor/iframeResizer.ie8.polyfils.js

This file was deleted.

Loading

0 comments on commit 921fbb2

Please sign in to comment.