Webpack

MP4 file not loading on React / Rails app

老子叫甜甜 提交于 2021-01-29 15:13:53
问题 I'm getting this error. From what I can google, it needs to configure the webpack file but in this rails app it's a webpacker.yml file. CRA looks like it works fine when using the usual tag. Any help would be appreciated. ./app/javascript/components/User/cover.mp4 1:0 Module parse failed: Unexpected character '' (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders (Source code

Webpack CSS chunks are extracted but not loaded - extract-css-chunks-webpack-plugin

浪尽此生 提交于 2021-01-29 15:10:15
问题 I'm currently working on code-splitting on CSS files on my React project. This project is built with webpack 3 , and with the help of extract-css-chunks-webpack-plugin, CSS chunks are generated nicely. However, I found that some chunks are not loaded or imported by any JS files. I've made a simplified project from my real project to demonstrate this issue. (here) In this example, when the dev-server.js is running, both app-[hash].js and app-[contentdash].css are loaded, while 0-[hash].js is

why I can not run npm run dev successfully in Laravel 7?

删除回忆录丶 提交于 2021-01-29 15:01:04
问题 Firstly, I installed a new Laravel 7 then, npm install npm run dev I got these errors, Again, Removed node_modules, then npm install --global cross-env, followed by removing cross-env from package.json, then npm run dev, **[![but also not worked. same errors][1]][1]** what can I do? @ dev C:\Xampp\htdocs\my-task npm run development @ development C:\Xampp\htdocs\my-task cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel

Importing foundation js package inside next project

帅比萌擦擦* 提交于 2021-01-29 14:30:54
问题 I added zurb foundation inside my next project and on the sass side I have no problems importing everything. The problems starts when I want to import the JS packages. I'm not entirely sure where the problem might be, the only thing I could understand this passed days is that it may be a webpack importing problem. Here is the index code import { useState, Component } from 'react'; import { connect } from 'react-redux'; import 'resources/main.scss'; import type { State } from 'AppState/Types';

How to use secondary endpoints to create API for Angular library

送分小仙女□ 提交于 2021-01-29 14:10:34
问题 Scenario: I created a custom UI library using ng-packagr , exported custom components and some model classes. Problem: In main project, import statement works fine for exported components but it doesn't work for exported classes and webpack fails to compile giving error: module not found error can't resolve my-custom-library/models Library project code: Model class: src/app/modules/my-custom-module/models/my-model.ts export class MyModel { constructor() { // default values for props here } //

css-loadel - how to correct use with webpack 5

回眸只為那壹抹淺笑 提交于 2021-01-29 13:56:15
问题 I have some files. Webpack config { test: cssModuleRegex, use: [ { loader: 'style-loader' }, { loader: 'css-loader', options: { modules: true, } }, ] }, main.module.scss .page { height: 100vh; display: flex; align-items: center; justify-content: center; } and i use it in react component as css-module import styles from './main.module.scss'; export class Main extends PureComponent<Props> { render() { return ( <div className={ styles.page }> <Logo /> </div> ); } } But it doesn't work If i

Cannot import bootstrap in nuxt vue component [duplicate]

爱⌒轻易说出口 提交于 2021-01-29 13:27:49
问题 This question already has answers here : “Uncaught SyntaxError: Cannot use import statement outside a module” when importing ECMAScript 6 (12 answers) Closed 10 months ago . I can't import bootstrap in any vue component (using latest nuxtjs). I get : My (simple) component is : <template> <h1>Empty index page</h1> </template> <script> import Modal from 'bootstrap/js/src/modal' export default {} </script> <style></style> I am really stuck. Do you have any idea or suggestion ? 回答1: You should

Webpack in React can't load the 3D model with a GLTF extension, shows 404 not found

六月ゝ 毕业季﹏ 提交于 2021-01-29 12:52:26
问题 I'm trying to load the 3D model with the .gltf extension in React with Typescript. The files in folder with 3D model are .gltf, .png and .bin files. The tools used for this task are webpack and useGLTFLoader from drei library. I've tried different tools. Mainly from three.js library with no effect. Error is showing that the 3D model is not found 404 (shown below) and nothing appears in place where 3D model should be placed. GET http://localhost:3000/assets/models/Duck/glTF/Duck.gltf 404 (Not

Webpack 4 - Add css file to multiple html files

空扰寡人 提交于 2021-01-29 11:36:21
问题 I want to bundle a couple of html files and add one css files into all of them. But my webpack configuration add only css and js bundled files to index.html My files looks like this: I want to add this main-hash.js and main-hash.css to all HTML files: about.html, index.html, contact.html Also when I exclude index.html (comment below) from file-loader my index.html don't recognize paths for public folder /images . Any ideas ?? const path = require('path'); const webpack = require('webpack');

How to set the REST api address in Angular according to build?

独自空忆成欢 提交于 2021-01-29 11:32:42
问题 I have an Angular front-end project generated by JHipster(5.8.2) and would like to adjust the settings so that when the build was 'prod' the REST API address would be a value and when the build was 'dev' the address would be another, however I could not make this change in the webpack.dev.js, webpack.prod.js, and webpack.common.js files. In the webpack.common.js file I set a value instead of empty string in SERVER_API_URL, however, this value was applied to all builds. I also tried using a