@bigbinary/neeto-commons-frontend 4.13.0-beta.12 → 4.13.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,11 @@ const commonResolve = require("@bigbinary/neeto-commons-frontend/configs/webpack
4
4
 
5
5
  module.exports = {
6
6
  ...commonResolve.alias,
7
+ "@bigbinary/neetoui/dist": path.resolve(
8
+ __dirname,
9
+ "../../../",
10
+ "neetoui/dist/index.css"
11
+ ),
7
12
  images: path.resolve(process.cwd(), "app/assets/images"),
8
13
  assert: require.resolve("assert/"),
9
14
  buffer: require.resolve("buffer/"),
@@ -1,4 +1,4 @@
1
- const { BABEL_CONFIG } = require("configs/esbuild/constants");
1
+ const { BABEL_CONFIG } = require("./constants");
2
2
 
3
3
  module.exports = api => {
4
4
  api.cache(true);
@@ -3,6 +3,7 @@ const dotenv = require("dotenv");
3
3
 
4
4
  const { prevalPlugin } = require("./plugins/preval.js");
5
5
  const svgr = require("./plugins/svgr.js");
6
+ const { virtualizedPlugin } = require("./plugins/virtualized.js");
6
7
 
7
8
  const postCssConfig = require("../../../../../postcss.config.js");
8
9
  const { BABEL_CONFIG } = require("../esbuild/constants.js");
@@ -15,7 +16,12 @@ const port = process.env.DEVSERVER_PORT || 8000;
15
16
 
16
17
  const config = {
17
18
  css: { postcss: postCssConfig },
18
- plugins: [svgr(), react({ babel: BABEL_CONFIG }), prevalPlugin()],
19
+ plugins: [
20
+ svgr(),
21
+ react({ babel: BABEL_CONFIG }),
22
+ virtualizedPlugin(),
23
+ prevalPlugin(),
24
+ ],
19
25
  resolve: { extensions: esbuildConfig.resolveExtensions },
20
26
  server: { port, origin: `http://localhost:${port}` },
21
27
  build: {
@@ -26,6 +32,7 @@ const config = {
26
32
  input: { application: entryPoint("app/javascript/packs/application.js") },
27
33
  },
28
34
  },
35
+ optimizeDeps: { include: ["react-virtualized"] },
29
36
  define: esbuildConfig.define,
30
37
  root: "app/javascript/packs",
31
38
  };
@@ -0,0 +1,21 @@
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+
4
+ const WRONG_CODE = `import { bpfrpt_proptype_WindowScroller } from "../WindowScroller.js";`;
5
+
6
+ const virtualizedPlugin = () => ({
7
+ name: "flat:react-virtualized",
8
+ configResolved() {
9
+ const file = require
10
+ .resolve("react-virtualized")
11
+ .replace(
12
+ path.join("dist", "commonjs", "index.js"),
13
+ path.join("dist", "es", "WindowScroller", "utils", "onScroll.js")
14
+ );
15
+ const code = fs.readFileSync(file, "utf-8");
16
+ const modified = code.replace(WRONG_CODE, "");
17
+ fs.writeFileSync(file, modified);
18
+ },
19
+ });
20
+
21
+ module.exports = { virtualizedPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-commons-frontend",
3
- "version": "4.13.0-beta.12",
3
+ "version": "4.13.0-beta.15",
4
4
  "description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
5
5
  "repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",