Webpack

How to Use Loaded SVG Module

隐身守侯 提交于 2021-01-29 08:11:16
问题 I have set up webpack to load SVG files into my TSX port of the create-react-app, per this answer: const logo = require('./logo.svg'); However, when I try to use it as follows I get a nasty 404. <img src={logo} className="App-logo" alt="logo" /> Failed to load resource: the server responded with a status of 404 () [object%20Module]:1 This makes sense - I require the svg, so it loads as a module, and you can't jolly well make a src URL out of that. That being said, how do I use an SVG loaded

(ERROR in multi) Module not found: Error: Can't resolve 'babel/loader'

梦想的初衷 提交于 2021-01-29 07:51:56
问题 This image contains folder structure and webpack.config.js file. When I open webpack-dev-server, I get the following error: ERROR in multi (webpack)-dev-server/client?http://localhost:8080 ./src/js/index.js ./src/scss/master.scss Module not found: Error: Can't resolve 'babel/loader' in 'C:\wamp64\www\o\omd' @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/js/index.js ./src/scss/master.scss main[0] Note than I have installed babel/loader inside node_modules . Any clue would be

TypeScript: Declare Different Libraries/References for Different Files Within the Same Project

那年仲夏 提交于 2021-01-29 07:38:07
问题 I have a project that is written in TypeScript. I use both the dom and Web Workers, so I need the webworker.d.ts library in some files and dom.d.ts in other files. I already tried adding "webworker" to the lib option in tsconfig.json, but those two are incompatible. Another thing I tried is adding: /// <reference no-default-lib="true"/> /// <reference lib="esnext" /> /// <reference lib="webworker" /> at the top of my service worker file, but "webworker" is applied to every file instead of

VSCode extension runs from development but does not work when packaged using webpack

荒凉一梦 提交于 2021-01-29 07:35:15
问题 I've built, run, packaged, and published an extension but the packager complains about 2509 files, 4.28MB and suggested using a bundler. I've followed the instructions on Bundling Extension and finally got it to build and run in my development environment using the extensionHost. After publishing this new package (14 files, 303.51KB) I find that while my contributed viewContainer and views are visible, it appears that my activate() function is never called. I've put vscode.window

TypeScript: Declare Different Libraries/References for Different Files Within the Same Project

我们两清 提交于 2021-01-29 07:31:47
问题 I have a project that is written in TypeScript. I use both the dom and Web Workers, so I need the webworker.d.ts library in some files and dom.d.ts in other files. I already tried adding "webworker" to the lib option in tsconfig.json, but those two are incompatible. Another thing I tried is adding: /// <reference no-default-lib="true"/> /// <reference lib="esnext" /> /// <reference lib="webworker" /> at the top of my service worker file, but "webworker" is applied to every file instead of

React native web issue with react native vector icons in storybook

限于喜欢 提交于 2021-01-29 07:28:45
问题 I created a project using react native web and I got react native icons working for web and mobile except on storybook. I'm not sure how to tell storybooks webpack config to load FontAwesome fonts. I tried adding FontAwesome in the preview-head.html but Still not showing the icons just a rectangle as a placeholder. What I would like is to have my icons showing up in the storybook webpack server. .storybook/main.js: const webpack = require('webpack'); const path = require('path'); const

Generate single module with webpack, with optional-to-load parts of the same module

可紊 提交于 2021-01-29 06:45:32
问题 I've created a library of date/time functions. (Why? I need some special features other libraries like Moment.js don't have.) There are some big chunks of data for handling historical Daylight Saving Time info that most users won't need, so I'd like them to be something that can be loaded optionally. This works fine when code is being loaded directly from npm libraries, but I'm trying to make the same code work when loaded as scripts directly into a web browser from unpkg.com. I'm finding

Webpack chunk styles and react.lazy

别等时光非礼了梦想. 提交于 2021-01-29 06:05:58
问题 I am facing the issue related to the order of the styles. In my case, I have an app, where I am using React.lazy, which will split our app ( JS and CSS ) to small chunks ( to improve initial load performance ). Problem is coming when we visit the first page ( so we will fetch JS + CSS related to that page ), then we will go to another page ( and also fetch JS + CSS to related page ). On the second page, we were overriding some styles, which we were using on the first page. Then we will back

Module build failed (from ./node_modules/babel-loader/lib/index.js):

前提是你 提交于 2021-01-29 05:55:43
问题 Well Here i'm trying to create a react app and want to use simple walletconnect package and trying to create a build file of my react app but i'm getting module error when i run webpack command to create the build file of my app. The traceback is given below: ERROR in ./frontend/src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module '@babel/preset-core' Require stack: - C:\Users\AHMED\Dotesrow\dotescrow\node_modules\@babel\core\lib\config

Vue.js: How to open/handle existing project by SourceMap or bundled files

五迷三道 提交于 2021-01-29 05:21:13
问题 Sorry for my stupid question. I am new in vue.js. I have vue.js project without source codes. I have to read Vue components and improve it. But some friends told me that it is imposimble to convert it back. Is it really imposible? Project file structure: /js -app.js -app.js.map -manifest.js -manifest.js.map -vendor.js -vendor.js.map 回答1: On vue >=2 that's basically impossible. Take a look here: https://forum.vuejs.org/t/any-method-or-workaround-to-decompile-dynamically-compiled-components