Comments (4)
Maybe it's worth to mention this in the docs? Or did I miss this?
from elm-brunch.
Found 1 of my problems - mainModules
should be an array.
Now the file compiles:
But when requiring it - it gets only an empty object:
from elm-brunch.
Good to hear that you solved the compilation problem. Beware that the elm brunch plugin does not pass the generated code on down the brunch pipeline, as other to-js-transpilers do. So you will need to either include the generated js in your html use other means to get it into the main bundle.
from elm-brunch.
@madsflensted , thank you.
Following your advice, I have added <script src="js/main.js"></script>
to the index.html
:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Simple Brunch Demo</title>
<link rel="stylesheet" href="app.css" />
</head>
<body>
<main id="root"></main>
<h1>
Brunch
<small>• A simple demo</small>
</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
<script src="libraries.js"></script>
<script src="js/main.js"></script>
<script src="app.js"></script>
<script>
require('application').init();
</script>
</body>
</html>
removed the const Elm = require('./elm/Main.elm');
from the application.js
.
'use strict';
const Greeter = require('./greeter');
const App = {
init() {
console.log('App initialized.');
const g = new Greeter();
g.greet();
Elm.Main.init({ node: document.getElementById('root') });
},
};
module.exports = App;
and now it is working:
from elm-brunch.
Related Issues (20)
- New way to create Brunch plugins HOT 10
- Error running elm-brunch HOT 6
- [TypeError: Cannot read property 'split' of undefined] HOT 6
- Problem with initial file compilation on Windows HOT 4
- Request: option to use use local elm binary HOT 4
- Multiple elm-package.json files HOT 2
- Request: 'merge' build strategy HOT 4
- Feature Request: 'elmx' support HOT 1
- Run tests automatically for PR
- Race condition in brunch compile HOT 2
- No color coding in terminal HOT 3
- Confused about configuration HOT 8
- relative path executablePath HOT 2
- brunch plugin build order HOT 12
- Fails in minimal test case HOT 1
- brunch build --production does not have a non-zero exit code on error HOT 12
- elm-brunch watch --server gets out of sync HOT 5
- Failing elm-make on 0.11.0 for a config that works on 0.10.0 HOT 5
- Elm 0.19 HOT 5
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 elm-brunch.