Results 1 to 2 of 2

Thread: Ext-react import custom package

  1. #1
    Sencha Premium Member matei's Avatar
    Join Date
    Jun 2008
    Location
    Cluj-Napoca
    Posts
    83
    Answers
    1

    Question Ext-react import custom package

    in ext-reactor I've imported a custom extjs package using packageDirs property from ExtJSReactorWebpackPlugin

    my package was published using npm and installed via npm.

    so final path was: /node_modules/@my-company/my-sencha-package-common

    Code:
    new ExtJSReactorWebpackPlugin({
            sdk: "./node_modules/@sencha/ext",
            toolkit: "classic",
            theme: "my-theme",
            overrides: ["overrides"],
            packages: ["company-common"],
            packageDirs: ["./node_modules/@my-company"],
            production: isProd
          }),
    how to change this code using ext-react?

    I've tried to add the same package in "ext-react-classic-boilerplate" example

    Code:
    new ExtWebpackPlugin({
            framework: 'react',
            toolkit: 'classic',
            port: port,
            profile: buildprofile, 
            environment: buildenvironment, 
            verbose: buildverbose,
            theme: 'theme-triton',
            packages: [
              "company-common"
            ]
    })
    but it does not request the correct classes from src. It tries to Require it dinamicaly at runtime and can't find it...

    and also packageDirs does not exist in new plugin, but I'd like to keep my packages inside @my-company folder not in @sencha

  2. #2
    Sencha Premium Member matei's Avatar
    Join Date
    Jun 2008
    Location
    Cluj-Napoca
    Posts
    83
    Answers
    1

    Exclamation

    just tried a simple use case and still does not work:

    generate a new package with:

    sencha generate package test-common

    add one class:

    c:\Products\extjs-react\packages\ext-react-classic-boilerplate\node_modules\@sencha\test-common\src\Thing.js

    in App.js add:


    Ext.require("Test.common.Thing");

    Result:
    ext.js:2560 GET http://localhost:1962/Test/common/Th...=1540217210771 net::ERR_ABORTED 404 (Not Found)

    And the weird part is that if I prefix my classes with "Ext." seems to load my classes.

Similar Threads

  1. Reference package without import it
    By paulosincos in forum Sencha Cmd
    Replies: 2
    Last Post: 5 Jan 2015, 3:29 AM
  2. How to import mixin in a package? Cannot load touch scss
    By NiceFall in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 8 Jan 2014, 3:28 PM
  3. Import Custom Component
    By christophe.braud in forum Sencha Architect 3.x: Q&A
    Replies: 1
    Last Post: 19 Oct 2013, 3:25 AM
  4. How to import specified package of js?
    By mophisoft in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 20 Jun 2007, 2:36 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •