Skip to content

Commit 76cd057

Browse files
committed
README: some clarifications
1 parent 4f5e521 commit 76cd057

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Create a new directory for your project.
88

99
Create the necessary files for an OpenFL project, including _project.xml_ and _.hx_ source files inside the project's root directory. Then, follow the remaining steps to setup Webpack and openfl-loader.
1010

11-
Run the following command to create a _package.json_ file:
11+
In a terminal, run the following command in the root of your project to create a _package.json_ file:
1212

1313
```sh
1414
npm init -y
1515
```
1616

17-
Run the following command to install the required dependencies:
17+
Then, run the following command to install the required dependencies:
1818

1919
```sh
2020
npm install --save-dev webpack-cli webpack-dev-server openfl-loader
@@ -35,7 +35,8 @@ Create a _webpack.config.js_ file in the root of your project:
3535
module.exports = {
3636
entry: "./project.xml",
3737
output: {
38-
filename: "bundle.js",
38+
// change xyz to an appropriate name for your project
39+
filename: "xyz.bundle.js",
3940
},
4041
module: {
4142
rules: [
@@ -54,6 +55,27 @@ module.exports = {
5455

5556
Create a _public/index.html_ file. Look inside _samples/basic_ sample for an example that's easy to copy with minor modifications.
5657

58+
In particular, you need to change the _basic.bundle.js_ path to the same output file name used in _webpack.config.js_:
59+
60+
```html
61+
<!--
62+
This bundle file name is defined in webpack.config.js
63+
-->
64+
<script src="./basic.bundle.js"></script>
65+
```
66+
67+
And you need to change the `lime.embed()` call to pass the same app file name used in _project.xml_.
68+
69+
```js
70+
/*
71+
the first argument passed to lime.embed() is the
72+
<app file="******"/> value from project.xml
73+
*/
74+
lime.embed("WebpackBasicSample", "openfl-content", 0, 0, {
75+
parameters: {},
76+
});
77+
```
78+
5779
To start a local development server, run the following command. Then, open _http://localhost:8080/_ in a web browser.
5880

5981
```sh

0 commit comments

Comments
 (0)