Webpack

Module build failed (from ./node_modules/css-loader/dist/cjs.js): CssSyntaxError

本小妞迷上赌 提交于 2021-02-11 11:57:11
问题 im building a react app and i imported a slider in a file and then i got a css-loader, im also using webpack here is my slider - import React, {useState} from 'react'; import RubberSlider from '@shwilliam/react-rubber-slider'; import styles from '@shwilliam/react-rubber-slider/dist/styles.css'; export const Slider = () => { const [value, setValue] = useState(0.5) return <RubberSlider width={250} value={value} onChange={setValue} /> } this ^ will go in another component and get called on but

Module build failed (from ./node_modules/css-loader/dist/cjs.js): CssSyntaxError

北城以北 提交于 2021-02-11 11:55:47
问题 im building a react app and i imported a slider in a file and then i got a css-loader, im also using webpack here is my slider - import React, {useState} from 'react'; import RubberSlider from '@shwilliam/react-rubber-slider'; import styles from '@shwilliam/react-rubber-slider/dist/styles.css'; export const Slider = () => { const [value, setValue] = useState(0.5) return <RubberSlider width={250} value={value} onChange={setValue} /> } this ^ will go in another component and get called on but

Tailwind css purge removes all dark classes

只愿长相守 提交于 2021-02-11 06:58:21
问题 I have a pretty simple project which uses a couple of colours extended to the theme. When I enable purging in my tailwind.config.js file, everything is purged as they should, but all of my dark classes get purged too. Does anyone have the same problem? I found an issue about this on tailwind's git as well: https://github.com/tailwindlabs/tailwindcss/discussions/2793 My resources are located in [PROJECT FOLDER] -resources -js -components Login.Vue I don't know if it's worth mentioning, but I

Pack HTML with html-webpack-plugin without packing any JavaScript

五迷三道 提交于 2021-02-11 06:10:23
问题 In another question, an accepted answer with 11 upvotes suggests using webpack's html-webpack-plugin to merge HTML+JS+CSS. Not a single word on how though, so that's my question. I have a documentation file, in HTML. It includes two external CSS files and one javascript file (syntax highlighter). I would like to bundle it all into one HTML file for easy distribution. I tried to use webpack without packing any JS with following webpack.config.js : const HtmlWebpackPlugin = require("html

Pack HTML with html-webpack-plugin without packing any JavaScript

僤鯓⒐⒋嵵緔 提交于 2021-02-11 06:06:31
问题 In another question, an accepted answer with 11 upvotes suggests using webpack's html-webpack-plugin to merge HTML+JS+CSS. Not a single word on how though, so that's my question. I have a documentation file, in HTML. It includes two external CSS files and one javascript file (syntax highlighter). I would like to bundle it all into one HTML file for easy distribution. I tried to use webpack without packing any JS with following webpack.config.js : const HtmlWebpackPlugin = require("html

Pack HTML with html-webpack-plugin without packing any JavaScript

有些话、适合烂在心里 提交于 2021-02-11 06:05:20
问题 In another question, an accepted answer with 11 upvotes suggests using webpack's html-webpack-plugin to merge HTML+JS+CSS. Not a single word on how though, so that's my question. I have a documentation file, in HTML. It includes two external CSS files and one javascript file (syntax highlighter). I would like to bundle it all into one HTML file for easy distribution. I tried to use webpack without packing any JS with following webpack.config.js : const HtmlWebpackPlugin = require("html

Error in loading nightmare while using webpack

雨燕双飞 提交于 2021-02-11 04:23:26
问题 I am trying to run nightmare on the browser but I have learnt that it is not possible so I am trying to use webpack to bundle it and build it. When I am trying to build it with npx webpack --config webpack.config.js ,I am getting the following message : WARNING in ./node_modules/nightmare/lib/nightmare.js 332:20-336:2 Critical dependency: the request of a dependency is an expression @ ./src/index.js ERROR in ./node_modules/nightmare/lib/nightmare.js Module not found: Error: Can't resolve

Error in loading nightmare while using webpack

霸气de小男生 提交于 2021-02-11 04:22:21
问题 I am trying to run nightmare on the browser but I have learnt that it is not possible so I am trying to use webpack to bundle it and build it. When I am trying to build it with npx webpack --config webpack.config.js ,I am getting the following message : WARNING in ./node_modules/nightmare/lib/nightmare.js 332:20-336:2 Critical dependency: the request of a dependency is an expression @ ./src/index.js ERROR in ./node_modules/nightmare/lib/nightmare.js Module not found: Error: Can't resolve

Error in loading nightmare while using webpack

纵饮孤独 提交于 2021-02-11 04:20:36
问题 I am trying to run nightmare on the browser but I have learnt that it is not possible so I am trying to use webpack to bundle it and build it. When I am trying to build it with npx webpack --config webpack.config.js ,I am getting the following message : WARNING in ./node_modules/nightmare/lib/nightmare.js 332:20-336:2 Critical dependency: the request of a dependency is an expression @ ./src/index.js ERROR in ./node_modules/nightmare/lib/nightmare.js Module not found: Error: Can't resolve

How to expose Vue as global object

 ̄綄美尐妖づ 提交于 2021-02-10 23:23:19
问题 I am integrating legacy code with newer one, built with Webpack. In legacy code, plain js accessed Vue simply with: new Vue(...) , from global scope. In Webpack, Vue will get sucked into vendor bundle and I would like to expose Vue back, so my legacy code would still see it as window.Vue What I have done so far (webpack 3.x): { test: require.resolve('vue/dist/vue.esm.js'), use: [{loader: 'expose-loader', options: 'Vue' }] } I get close with this, but I end up with window.Vue.default having