-
-
Notifications
You must be signed in to change notification settings - Fork 201
Vue.js Loader #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue.js Loader #49
Conversation
60b4b50
to
5de194e
Compare
This is ready to go 🍰 Notes:
|
lib/loaders/sass.js
Outdated
@@ -35,10 +37,10 @@ module.exports = { | |||
|
|||
sassLoaders.push({ | |||
loader: 'sass-loader', | |||
options: { | |||
options: Object.assign(sassOptions, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not alter the sassOptions object passed as argument. It could have side effects. Use this instead: Object.assign({}, sassOptions, { sourceMap: ... })
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
lib/loaders/vue.js
Outdated
|
||
scss: extractText.extract( | ||
webpackConfig, | ||
sassLoaderUtil.getLoaders(webpackConfig, {}, true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this require having sass-loader installed as soon as you use vue-loader, even if you never use Sass in your project, but less (same in the opposite way for the less
config of course) ?
test/functional.js
Outdated
* That's because, in theory, you should be able to | ||
* run Encore from other directories, give you set | ||
* the context. However, in this case, the vue-loader | ||
* users load-postcss-config to load the postcss config, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: uses
test/functional.js
Outdated
* run Encore from other directories, give you set | ||
* the context. However, in this case, the vue-loader | ||
* users load-postcss-config to load the postcss config, | ||
* but it uses process.cwd() to find it, instead of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the context an Encore thing or a webpack one ? If it is a webpack one, it would be worth discussing this upstream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context is a webpack thing... and it's meant to be the root from which entry files are loaded. It's unclear to me whether context should also be used for other things, like the directory where postcss.config.js should be loaded (we do give it a bit more importance in Encore)
I added one more commit to change the vue-loader options to a callback - consistent with #50 and |
This PR was merged into the master branch. Discussion ---------- Vue.js Loader Commits ------- 8c0aebd only adding alias when present 7b00ec8 Changing vue options to be a callback 2e1f9f7 Throw an error if the user tries to use (e.g.) lang="scss" in vue, but has not activated that loader 0d5cdd5 Completing vue-loader support 4094a73 Fix unit test cf2c1a7 Add vue-template-compiler dependency 5207a28 Allow to add vues loader
No description provided.