Move all static files to public/ folder and fix paths
This commit is contained in:
parent
83161dc7e0
commit
0ba89c8d9c
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
dist
|
||||
public/bundle.js
|
||||
public/bundle.js.map
|
||||
node_modules
|
||||
npm-debug.log
|
||||
*.swp
|
||||
|
|
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 178 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
@ -6,9 +6,9 @@
|
|||
<title>Notica - Notifications from Your Terminal</title>
|
||||
|
||||
<![if lt IE 10]>
|
||||
<script async src="/assets/js/es5-shim.min.js"></script>
|
||||
<script async src="/assets/js/es5-sham.min.js"></script>
|
||||
<script async src="/assets/js/html5shiv.min.js"></script>
|
||||
<script async src="/js/es5-shim.min.js"></script>
|
||||
<script async src="/js/es5-sham.min.js"></script>
|
||||
<script async src="/js/html5shiv.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
// Fake console to test in IE<9
|
||||
if( typeof console == 'undefined' )
|
||||
|
@ -23,11 +23,11 @@
|
|||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css" integrity="sha256-t2/7smZfgrST4FS1DT0bs/KotCM74XlcqZN5Vu7xlrw=" crossorigin="anonymous" media="none" onload="if(media!='all')media='all'" />
|
||||
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" media="none" onload="if(media!='all')media='all'" />
|
||||
|
||||
<link rel="stylesheet" href="/assets/css/style.css" type="text/css" media="all" />
|
||||
<link rel="stylesheet" href="/css/style.css" type="text/css" media="all" />
|
||||
</head>
|
||||
<body>
|
||||
<div id='root'>
|
||||
</div>
|
||||
<script src="/static/bundle.js"></script>
|
||||
<script src="/bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -9,10 +9,9 @@ const port = 3000;
|
|||
|
||||
app.use(bodyParser.urlencoded({ extended: false }));
|
||||
|
||||
app.use('/static', express.static(path.join(__dirname, 'dist')));
|
||||
app.use('/assets', express.static(path.join(__dirname, 'assets')));
|
||||
app.use('/', express.static(path.join(__dirname, 'public')));
|
||||
app.get('/*', (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'index.html'));
|
||||
res.sendFile(path.join(__dirname, 'public/index.html'));
|
||||
});
|
||||
|
||||
app.post('*', (req, res) => {
|
||||
|
|
|
@ -3,7 +3,7 @@ var WebpackDevServer = require('webpack-dev-server');
|
|||
var config = require('./webpack.config');
|
||||
|
||||
new WebpackDevServer(webpack(config), {
|
||||
publicPath: config.output.publicPath,
|
||||
contentBase: './public',
|
||||
hot: true,
|
||||
historyApiFallback: true,
|
||||
noInfo: true
|
||||
|
|
|
@ -50,13 +50,13 @@ export default class NotifPage extends React.Component {
|
|||
|
||||
let options = {
|
||||
body: 'Notification from Notica',
|
||||
icon: 'assets/img/icon.png',
|
||||
iconUrl: 'assets/img/icon.png',
|
||||
icon: 'img/icon.png',
|
||||
iconUrl: 'img/icon.png',
|
||||
vibrate: [200, 100, 200]
|
||||
};
|
||||
|
||||
try {
|
||||
navigator.serviceWorker.register('/assets/js/sw.js').then((reg) => {
|
||||
navigator.serviceWorker.register('/js/sw.js').then((reg) => {
|
||||
reg.showNotification(title, options);
|
||||
});
|
||||
} catch (e) { // If we are on a browser without serviceWorker
|
||||
|
|
|
@ -32,7 +32,7 @@ export default class Site extends React.Component {
|
|||
<div className="hero">
|
||||
<div className="title">
|
||||
<Link to={'/home/' + id}>
|
||||
<img src="/assets/img/logo.svg" />
|
||||
<img src="/img/logo.svg" />
|
||||
<span className="name">Notica</span>
|
||||
</Link>
|
||||
</div>
|
||||
|
|
|
@ -9,9 +9,9 @@ module.exports = {
|
|||
'./src/index'
|
||||
],
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
path: path.join(__dirname, 'public'),
|
||||
filename: 'bundle.js',
|
||||
publicPath: '/static/'
|
||||
publicPath: ''
|
||||
},
|
||||
plugins: [
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
|
|
|
@ -7,9 +7,9 @@ module.exports = {
|
|||
'./src/index'
|
||||
],
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
path: path.join(__dirname, 'public'),
|
||||
filename: 'bundle.js',
|
||||
publicPath: '/static/'
|
||||
publicPath: ''
|
||||
},
|
||||
plugins: [
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
|
|
Loading…
Reference in New Issue
Block a user