Webpack

Add external javascript file to React.js app

删除回忆录丶 提交于 2021-02-11 14:48:00
问题 I'm having a little problem adding external javaScript file to my React App. I tried so many things but none of them worked. The last thing I did is: step#1 : creating JS file and create functions. step#2 : import the functions form my js file. step#3 : call the functions. The issue is when I run: npm start, everything work fine. But when I run: nom build, the script won't work! This is my js file that I created with exporting functions export function BackgroundMove() { $(document).ready

Webpack Dev Server cannot find modules with Typescript if I use custom paths in tsconfig

 ̄綄美尐妖づ 提交于 2021-02-11 14:21:58
问题 I'm building a project from scratch on React + TypeScript and using the Webpack Dev server. I want to use relative paths to components, which will be not strict for a more flexible development. In my App.tsx, I'm trying to import component: import EntityTypes from "components/EntityTypes/EntityTypes"; and getting an error Module not found: Error: Can't resolve 'components/EntityTypes/EntityTypes' in '/home/eugene/prj/work/crud-react/src' File by this path exists (/src/components/EntityTypes

SaxonJS unusable with webpack

左心房为你撑大大i 提交于 2021-02-11 13:36:28
问题 I'm running into an issue when trying to integrate SaxonJS into a larger web application using webpack . From what I can tell, webpack views SaxonJS as just another module, but SaxonJS is not structured as an AMD or CommonJS module. Instead, the Big.js (a SaxonJS dependency) hijacks the export. I believe that fixing Node.js support will also fix this issue. import * as SaxonJS from "./Saxon-JS/SaxonJS.js"; export class Transformer { public static transform(inputStr: string, sefFile: string,

(Expo with Electron) Disable native scrollbehavior

独自空忆成欢 提交于 2021-02-11 13:22:53
问题 i wanna build a desktop app with electron and expo (electron-adapter). The problem is that the body of the nested page automatically adds a scrollbar. Does anyone have a solution for this or knows how to disable this scrollbehavior? Or how to fix the header in expo? In case you need more information please let me know! Thanks for the help! 来源: https://stackoverflow.com/questions/60600943/expo-with-electron-disable-native-scrollbehavior

(Expo with Electron) Disable native scrollbehavior

十年热恋 提交于 2021-02-11 13:21:50
问题 i wanna build a desktop app with electron and expo (electron-adapter). The problem is that the body of the nested page automatically adds a scrollbar. Does anyone have a solution for this or knows how to disable this scrollbehavior? Or how to fix the header in expo? In case you need more information please let me know! Thanks for the help! 来源: https://stackoverflow.com/questions/60600943/expo-with-electron-disable-native-scrollbehavior

Can't deploy webpack to gh-pages (react app)

拟墨画扇 提交于 2021-02-11 13:09:25
问题 First time using webpack as well as deploying using gh-pages. I cloned a webpack project from a udemy course. Instructor doesn't get into how to actually use webpack. It's telling me that [etc.]/build doesn't exist. When I create a build folder, I get the same error. package.json: "scripts": { "start": "node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js", "build": "webpack -p --config ./webpack.production.config.js", "test": "mocha --compilers js:babel-core/register --require .

Something went wrong installing the “sharp” module, using node-loader in webpack

狂风中的少年 提交于 2021-02-11 12:47:08
问题 I use sharp and webpack with node-loader but I got this error: D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx\dist\cms\core\server\express.js:150011 throw new Error(error); ^ Error: Something went wrong installing the "sharp" module node-loader: Error: The specified module could not be found. D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx\dist\cms\core\server/33c1e48f049ce3285905e286d212a201.node - Remove the "node_modules/sharp" directory then run "npm install --ignore-scripts=false -

Something went wrong installing the “sharp” module, using node-loader in webpack

女生的网名这么多〃 提交于 2021-02-11 12:45:40
问题 I use sharp and webpack with node-loader but I got this error: D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx\dist\cms\core\server\express.js:150011 throw new Error(error); ^ Error: Something went wrong installing the "sharp" module node-loader: Error: The specified module could not be found. D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx\dist\cms\core\server/33c1e48f049ce3285905e286d212a201.node - Remove the "node_modules/sharp" directory then run "npm install --ignore-scripts=false -

How to access webpack config variable in other js file

会有一股神秘感。 提交于 2021-02-11 12:38:10
问题 I am running following command to run the app locally npm run start package.json ... "scripts": { "start": "concurrently --kill-others --kill-others-on-fail -p name --names \"config\" \"npm run start:config\"", "build": "npm run build:config", "build:config": "webpack --config ./webpack.config.config.js -p", "start:config": "webpack-dev-server --config ./webpack.config.config.dev.js --port 4200" }, ... I am trying to access env mode in scripts.js defined in webpack config js as shown below

Symfony 5 and sudo commad using Windows 10

孤街醉人 提交于 2021-02-11 12:19:07
问题 I am following Fabien Potencier's book "Symfony 5: The Fast Track". I develop the project using Windows 10 pro 64 bit. The author of the book, however, works with Linux. In chapter 27 the following command should be executed, which works on Linux, but not on Windows 10: sudo API_ENDPOINT = 'symfony var: export SYMFONY_DEFAULT_ROUTE_URL --dir = ..' yarn encore dev I have installed Sudo for Windows, but the problem is not solved. How do I run this command on Windws 10? 来源: https://stackoverflow