Skip to content

Commit

Permalink
feat: works and still need static bower_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
vagusX committed Mar 27, 2017
1 parent 005d663 commit 985b2be
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
20 changes: 8 additions & 12 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import loaderUtils from 'load-utils'
import loaderUtils from 'loader-utils'

export default function () {}
module.exports = () => ''

export function pitch (remainingRequest) {
module.exports.pitch = function (remainingRequest) {
this.cacheable && this.cacheable()

// console.log(loaderUtils.stringifyRequest(this, '!!' + remainingRequest))
const url = loaderUtils.interpolateName(this, '[path][name].[ext]', {
context: this.options.context
})

const srcFilepath = this.resourcePath
// const srcDirpath = path.dirname(srcFilepath)
const tmp = `
return `
var link = document.createElement('link')
link.rel = 'import'
link.href = '${srcFilepath}'
link.href = '${url}'
document.head.appendChild(link)
`

const result = tmp.replace(/\n\s+/g, ' ')

return result
}
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,19 @@
},
"homepage": "https://github.com/vagusX/html-imports-loader#readme",
"devDependencies": {
"ghooks": "^1.3.2",
"onchange": "^3.0.2",
"rimraf": "^2.5.4",
"rollup": "^0.36.0",
"rollup-plugin-buble": "^0.14.0",
"ghooks": "^2.0.0",
"onchange": "^3.2.1",
"rimraf": "^2.6.1",
"rollup": "^0.41.6",
"rollup-plugin-buble": "^0.15.0",
"rollup-plugin-eslint": "^3.0.0",
"rollup-plugin-node-globals": "^1.0.8",
"rollup-plugin-node-globals": "^1.1.0",
"semantic-release": "^6.3.2",
"standard": "^8.1.0",
"tape": "^4.6.0",
"standard": "^9.0.2",
"tape": "^4.6.3",
"validate-commit-message": "^3.0.1"
},
"dependencies": {
"loader-utils": "^0.2.16"
},
"version": "0.0.0-development"
"loader-utils": "^1.1.0"
}
}

0 comments on commit 985b2be

Please sign in to comment.