Comments (11)
Hi, you should not set the scalaJSModuleKind
to NoModule
when using the module bundler. Let it be CommonJSModule
.
Also, can you show me the code of your facade and the way you use it?
Last, Iโm not totally sure but I think the right scope for the webpack
task is webpack in (Compile, fullOptJS)
.
from scalajs-bundler.
Hi, this two modifications lead to this:
demo.js:2 Uncaught ReferenceError: exports is not defined
index.html:13 Uncaught ReferenceError: demo is not defined
That's why I had switched from NoModule to CommonJSModule.
And my facade is this:
import org.scalajs.dom.Element
import scala.scalajs.js
@js.native
class Modal(element: Element) extends js.Object {
def open(): Unit = js.native
def close(): Unit = js.native
}
I tried to use JSImport, but I didn't understand how to use it, but it is certainly the key !
from scalajs-bundler.
Indeed you have to use @JSImport
. Does this section help? Can you elaborate on whatโs unclear?
from scalajs-bundler.
In your case, I guess you want to annotate your Modal
class with the following: @JSImport("bootstrap.native", "Modal")
from scalajs-bundler.
Mmh, same result sadely :(. I do not understand what is the JSImport first parameter ? A js file name ? A namespace ?
from scalajs-bundler.
Could you share a project from which I can reproduce the issue, please?
The first parameter of @JSImport
is the CommonJS module name, as explained in the documentation
from scalajs-bundler.
BTW, why are you enabling the WebScalaJSBundlerPlugin
on the demo
project?
from scalajs-bundler.
Yes I do. I pushed my modifications in the scalajsbundler branch in the repo https://github.com/openmole/scaladget. Launch the runDemo key. And then open the demo/target/index.html. Thanks !
from scalajs-bundler.
I fixed the problem here: openmole/scaladget#8
from scalajs-bundler.
Yes, it works fine ! Thanks. This plugin is really amazing. It render possible to build really smart libs !
from scalajs-bundler.
Good to know that it works for you :)
from scalajs-bundler.
Related Issues (20)
- (newb) Is there a way to get the image optimisation and CSS rewriting? HOT 2
- is npm ci supported? HOT 3
- The Strict Mode emitted by Scala.js is not always preserved
- Add first-class support for frozen lockfiles HOT 7
- Generated source map points to incorrect URLs
- BundlingMode.LibraryOnly ignores `require` and `js.import`
- Documentation reports incorrect version HOT 3
- installJsdom may installs jsdom outside of the target directory
- Support `packageManager` in package.json
- Support Node Version Manager (NVM) HOT 2
- Error parsing webpack stats output HOT 6
- Providing `nodeExecCommand` setting HOT 4
- Yarn 2 throws `Unsupported option name ("--mutex")`
- sourcemap not work with BundlingMode.LibraryAndApplication
- Release v0.21.0 HOT 1
- Use with IntegrationTests
- BundlingMode.LibraryAndApplication() does not work with sourcemap to false
- digital envelope routines::unsupported on node versions > 16 HOT 3
- `AssertionError` on sbt 1.8.0 HOT 4
- webpackExtraArgs is ignored
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalajs-bundler.