https://google.com/#q=import%2Fno-webpack-loader-syntax Unexpected '!' in 'expose-loader?$!expose-loader?jQuery!j query'. Do not use import syntax to configure webpack loaders위와 같은
위와 같은 코드에러가 났을 때!
eslint 때문에...!!!!
삽질을 몇 시간동안 한듯
다시 호흡 가다듬고 jquery 설치부터
1. 먼저 jquery를 install 해준다.
npm install jquery --save
2. build/webpack.base.conf.js 파일에 plugins 추가
module.exports = { plugins: [ new webpack.ProvidePlugin({ $: 'jquery', jquery: 'jquery', 'window.jQuery': 'jquery', jQuery: 'jquery' }) ] ... }
3. 그리고 webpack.base.conf.js 파일(2번과 같은 파일) 최상단에 webpack 적어두고,
const webpack = require('webpack')
4. 만약 eslint 사용하고 있으면 최상위루트의 .eslintrc.js 파일에 globals 붙여넣기
module.exports = { globals: { "$": true, "jQuery": true }, ...
위 솔루션은
https://maketips.net/tip/223/how-to-include-jquery-into-vuejs 여기 참고하여 해결함ㅠㅠㅠ
'Study > Vue.js' 카테고리의 다른 글
[vue.js] Eventbus 만들기 (0) | 2018.10.22 |
---|---|
[Vue.js] 페이징 로직 (0) | 2018.10.22 |
[Vue.js] promise 사용하기 (0) | 2018.09.20 |
[Vue.js] class를 만들어 vue객체 사용하기 (0) | 2018.09.20 |
[Vue.js] mixin 전역 등록하기 (0) | 2018.09.20 |
[vue] img src data binding (0) | 2018.09.07 |
vue.js radio button 토글 이벤트 걸기 (0) | 2018.07.12 |
vue.js axios로 데이터 가져와서 이벤트 걸기 (0) | 2018.07.10 |