-
Notifications
You must be signed in to change notification settings - Fork 907
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/node:lts | ||
|
||
working_directory: ~/repo | ||
|
||
steps: | ||
- checkout | ||
|
||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "yarn.lock" }} | ||
- v1-dependencies- # used if checksum fails | ||
|
||
- run: yarn install | ||
|
||
- save_cache: | ||
paths: | ||
- node_modules | ||
- ~/.cache/yarn | ||
key: v1-dependencies-{{ checksum "yarn.lock" }} | ||
|
||
- run: yarn lint | ||
- run: yarn test |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,11 @@ | |
"scripts": { | ||
"dev": "tsc --watch", | ||
"build": "tsc", | ||
"pretest": "tsc", | ||
"test": "jest", | ||
"dev-example": "webpack-dev-server --config example/webpack.config.js --inline --hot", | ||
"build-example": "rm -rf example/dist && webpack --config example/webpack.config.js --env.prod", | ||
"lint": "prettier --write --parser typescript \"src/**/*.ts\"", | ||
"lint": "prettier --write --parser typescript \"{src,test}/**/*.ts\"", | ||
"prepublishOnly": "tsc" | ||
}, | ||
"gitHooks": { | ||
|
@@ -30,6 +32,7 @@ | |
] | ||
}, | ||
"dependencies": { | ||
"@types/mini-css-extract-plugin": "^0.9.1", | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sodatea
Author
Member
|
||
"chalk": "^3.0.0", | ||
"hash-sum": "^2.0.0", | ||
"loader-utils": "^1.2.3", | ||
|
@@ -41,28 +44,40 @@ | |
"@babel/preset-env": "^7.7.7", | ||
"@types/estree": "^0.0.42", | ||
"@types/hash-sum": "^1.0.0", | ||
"@types/jest": "^25.2.1", | ||
"@types/loader-utils": "^1.1.3", | ||
"@types/webpack": "^4.41.0", | ||
"@types/webpack-merge": "^4.1.5", | ||
"@vue/compiler-sfc": "^3.0.0-beta.9", | ||
"babel-loader": "^8.0.6", | ||
"cache-loader": "^4.1.0", | ||
"css-loader": "^3.3.2", | ||
"file-loader": "^5.0.2", | ||
"jest": "^24.9.0", | ||
"jest": "^25.5.4", | ||
"lint-staged": "^9.5.0", | ||
"memfs": "^3.1.2", | ||
"mini-css-extract-plugin": "^0.8.0", | ||
"prettier": "^1.19.1", | ||
"pug": "^2.0.4", | ||
"pug-plain-loader": "^1.0.0", | ||
"stylus": "^0.54.7", | ||
"stylus-loader": "^3.0.2", | ||
"ts-jest": "^24.2.0", | ||
"ts-jest": "^25.5.1", | ||
"typescript": "^3.7.3", | ||
"url-loader": "^3.0.0", | ||
"vue": "^3.0.0-beta.9", | ||
"webpack": "^4.41.2", | ||
"webpack-cli": "^3.3.10", | ||
"webpack-dev-server": "^3.9.0", | ||
"webpack-merge": "^4.2.2", | ||
"yorkie": "^2.0.0" | ||
}, | ||
"jest": { | ||
"preset": "ts-jest", | ||
"testEnvironment": "node", | ||
"testPathIgnorePatterns": [ | ||
"<rootDir>/dist/", | ||
"<rootDir>/node_modules/" | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
const webpack = require('webpack') | ||
let VueLoaderPlugin = null | ||
import webpack from 'webpack' | ||
declare class VueLoaderPlugin implements webpack.Plugin { | ||
static NS: string | ||
apply(compiler: webpack.Compiler): void | ||
} | ||
|
||
let Plugin: typeof VueLoaderPlugin | ||
|
||
if (webpack.version && webpack.version[0] > 4) { | ||
if (webpack.version && webpack.version[0] > '4') { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
// webpack5 and upper | ||
VueLoaderPlugin = require('./pluginWebpack5') | ||
Plugin = require('./pluginWebpack5').default | ||
} else { | ||
// webpack4 and lower | ||
VueLoaderPlugin = require('./pluginWebpack4') | ||
Plugin = require('./pluginWebpack4').default | ||
} | ||
|
||
module.exports = VueLoaderPlugin | ||
export default Plugin |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { bundle } from './utils' | ||
|
||
test('basic', async () => { | ||
await bundle({ entry: 'basic.vue' }) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<template> | ||
<h2 class="red">{{msg}}</h2> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { | ||
msg: 'Hello from Component A!' | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
comp-a h2 { | ||
color: #f00; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Component from '~target' | ||
import * as exports from '~target' | ||
|
||
if (typeof window !== 'undefined') { | ||
window.module = Component | ||
window.exports = exports | ||
} | ||
|
||
export default Component |
5 comments
on commit 0b35f5c
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.
beta.2
has broken my Webpack build, specifically my PostCss loaders on styles.
There are only 2 commits compared to beta.1
and I've tried reverting the other commit (didn't fix my issue).
So I'm left thinking this commit introduced a big breaking change.
I can't see what would have, but this commit restored Yarn packages and caught quite a few major version bumps in the lot, so that might be the cause.
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.
@jods4 Do you have a reproduction repo?
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.
@sodatea JS is such a 💩 environment to work in. 👿
I just spent hours on this and I still have no idea what's wrong. I can't share the real project and my attempts at repro have failed.
When looking at the error:
ERROR in ./ClientApp/Components/Forms/input.scss?vue&type=style&index=0&lang=css (./node_modules/css-loader/dist/cjs.js!./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src??postcss!./ClientApp/Components/Forms/input.scss?vue&type=style&index=0&lang=css)
Module build failed (from ./node_modules/css-loader/dist/cjs.js):
CssSyntaxError
It's clear that something (prob. vue-loader) has incorrectly manipulated the chain of loaders.
If you look closely at the chain you can see this:
- css-loader (Wrong, should not be here!)
- style-loader
- css-loader (correct)
- postcss-loader
./ClientApp/Components/Forms/input.scss?vue&type=style&index=0&lang=css
(the target, a scss file that was@import
ed in.vue
).
I still have no idea what's going on and as I said simple repros work.
All I can say for now is that I didn't have this problem on beta-1.
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.
@sodatea Found it!
It's unrelated to post-css, even plain css is broken.
What broke is when you load an external file in a vue component, like so:
<style src="./test.css">
</style>
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.
why is this dependency here and not in devDependencies?