Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ module.exports = class Config {
_core: 'jade'
}, {
exclude: opts.ignore.map(mmToRe),
loader: 'file-loader',
query: { dumpDirs: opts.dumpDirs },
loader: 'source-loader',
_core: 'static'
}
]
Expand Down
7 changes: 1 addition & 6 deletions lib/plugins/static_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ module.exports = class StaticWebpackPlugin {
/* istanbul ignore next */
if (dep.error) { return done(dep.error) }

// webpack stores this value using the relative path as a key
let relativePath = this.util.getOutputPath(f)
.replace(this.util.conf.context, '')

// now we pull the value from the dependency using the correct key
const src = dep.assets[relativePath]._value
const src = dep._src

const outputPath = this.util.getOutputPath(f)
compilation.assets[outputPath] = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"browser-sync-webpack-plugin": "^1.0.1",
"cheerio": "^0.20.0",
"css-loader": "^0.23.1",
"file-loader": "static-dev/file-loader",
"glob": "^7.0.3",
"hygienist-middleware": "^0.1.1",
"jade": "^1.11.0",
Expand All @@ -30,6 +29,7 @@
"postcss-loader": "^0.9.1",
"require-from-string": "^1.2.0",
"rimraf": "^2.5.2",
"source-loader": "^0.1.0",
"sprout": "^1.2.0",
"webpack": "^1.13.0",
"when": "^3.7.7"
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/static_plugins/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ module.exports = class GladePlugin {
const dep = compilation.modules.find((el) => {
if (el.userRequest === f) { return el }
})
let src = String(dep.assets['foo.glade']._value)
let src = String(dep._src)
src = src.replace(/glade/, 'Glade Air Freshener™')
dep.assets['foo.glade']._value = Buffer(src)
dep._src = Buffer(src)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

})
done()
})
Expand Down