Renamed app.js back to index.js

no-issue

Preact was having issues when the entrypoint wasn't named index.js
This commit is contained in:
Fabien O'Carroll 2019-05-08 11:42:42 +02:00
parent fddc13bca1
commit 497934bb6a
3 changed files with 25 additions and 25 deletions

View File

@ -1,24 +0,0 @@
import './styles/members.css';
import {Component} from 'preact';
import MembersProvider from './components/MembersProvider';
import Modal from './components/Modal';
export default class App extends Component {
constructor() {
super();
const apiUrl = window.location.href.substring(0, window.location.href.indexOf('/members/auth'));
this.state = {
apiUrl
};
}
render() {
return (
<MembersProvider apiUrl={ this.state.apiUrl }>
<Modal />
</MembersProvider>
);
}
}

View File

@ -0,0 +1,24 @@
import './styles/members.css';
import {Component} from 'preact';
import MembersProvider from './components/MembersProvider';
import Modal from './components/Modal';
export default class App extends Component {
constructor() {
super();
const apiUrl = window.location.href.substring(0, window.location.href.indexOf('/members/auth'));
this.state = {
apiUrl
};
}
render() {
return (
<MembersProvider apiUrl={ this.state.apiUrl }>
<Modal />
</MembersProvider>
);
}
}

View File

@ -9,7 +9,7 @@
"dev": "yarn build --no-production && preact watch --port=8080",
"clean": "rm -rf dist && mkdir dist",
"prebuild": "npm run clean",
"build": "preact build --template=index.html --src=app.js --dest=dist --service-worker=false --no-prerender",
"build": "preact build --template=index.html --src=index.js --dest=dist --service-worker=false --no-prerender",
"prepublishOnly": "npm run build",
"pretest": "npm run clean",
"test": "NODE_ENV=testing mocha './test/**/*.test.js'",