The New Way to Build with AI! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Browse ReUI Pro

Build,import themes plugin.bundle.js with Webpack in symfony


When do I run npm run watch in symfony then I got warning: "./locale" in plugin/bundle.js.
INFO: "assets/global/plugin/bundle.js" imported at app.js (assets/app.js)".
//app.js => path: assets/app.js

import './bootstrap.js';
import './config.js';
import moment from 'moment';
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/

// any CSS you import will output into a single css file (app.css in this case)

import './cms/assets/plugins/global/plugins.bundle.css'
import './cms/assets/css/style.bundle.css'

import './cms/assets/plugins/global/plugins.bundle.js';
import './cms/assets/js/scripts.bundle.js';


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)

 
Deleted comment
 
Deleted comment

Hi,

The warning ./locale in plugin/bundle.js typically happens because Webpack is trying to resolve and bundle all the locales provided by the moment library. Since moment includes a lot of locales you might not need, this can unnecessarily increase your JavaScript bundle size.

Make sure you’re not importing any unnecessary locales in your app.js. For example:


import moment from "moment";
// Explicitly import only the locales you need
import "moment/locale/en";
import "moment/locale/fr";

// Set the default locale
moment.locale("en");
This should help reduce the bundle size and remove the warning.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
buy metronic keenthemes mega bundle

ReUI

Open-source React components, blocks and templates built on shadcn/ui and Tailwind CSS by Keenthemes.