You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
I'm using Webpack 1.x and trying to extract <style> from .vue files into a dedicated CSS file. Today I'm trying to integrate happypack into this setup.
Here's the code from the vue-loader docs on how to do this, apart from happypack:
var ExtractTextPlugin = require("extract-text-webpack-plugin")
module.exports = {
// other options...
module: {
loaders: [
{
test: /\.vue$/,
loader: 'vue'
},
]
},
vue: {
loaders: {
css: ExtractTextPlugin.extract("css"),
// you can also include <style lang="less"> or other langauges
less: ExtractTextPlugin.extract("css!less")
}
},
plugins: [
new ExtractTextPlugin("style.css")
]
}
Is there a way to translate this into happypack? I've looked at your complex example here but it doesn't seem complete and I can't tell if you're actually lifting CSS from JSX files or not.
The big problem is that once you go the route of using happypack, the vue object in the code block above gets completely ignored. We need to be using the vue-loader but also somehow passing this vue object. Just can't figure out a way to do this in happypack.
Would welcome any tips on this! Thanks.
The text was updated successfully, but these errors were encountered:
The problem with the vue object in your configuration is that it can't be serialized and communicated across processes since it contains functions. Only JSON-serializable options are supported. If vue-loader accepted a file path to a config file (like babel does with .babelrc and postcss loader and so on) which it would then require then it can work.
Having said that, you can instruct happypack to expose custom keys from the compiler configuration object by monkey-patching HappyPack.SERIALIZABLE_OPTIONS:
I'm using Webpack 1.x and trying to extract
<style>
from.vue
files into a dedicated CSS file. Today I'm trying to integrate happypack into this setup.Here's the code from the vue-loader docs on how to do this, apart from happypack:
Is there a way to translate this into happypack? I've looked at your complex example here but it doesn't seem complete and I can't tell if you're actually lifting CSS from JSX files or not.
The big problem is that once you go the route of using happypack, the
vue
object in the code block above gets completely ignored. We need to be using thevue-loader
but also somehow passing thisvue
object. Just can't figure out a way to do this in happypack.Would welcome any tips on this! Thanks.
The text was updated successfully, but these errors were encountered: