-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
81 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> | ||
<title><%= htmlWebpackPlugin.options.title %></title> | ||
</head> | ||
<body> | ||
<noscript> | ||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> | ||
</noscript> | ||
<div id="app"></div> | ||
<!-- built files will be auto injected --> | ||
</body> | ||
{% extends "base.html" %} | ||
{% block html %} | ||
<!doctype html> | ||
<html {% block html_tag_attributes %}{{ block.super }}{% endblock %}> | ||
<head> | ||
{% block head %}{{ block.super }}{% endblock %} | ||
<!-- html-webpack-inject will inject head assets below --> | ||
</head> | ||
<body {% block body_tag_attributes %}{{ block.super }}{% endblock %}> | ||
{% block body %}{{ block.super }}{% endblock %} | ||
<!-- html-webpack-inject will inject body assets below --> | ||
</body> | ||
</html> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = { | ||
publicPath: process.env.NODE_ENV === 'production' ? '/static/dist/' : 'http://127.0.0.1:8080', | ||
outputDir: '../server/static/dist', | ||
indexPath: '../../templates/base-vue.html', // relative to outputDir! | ||
|
||
chainWebpack: config => { | ||
/* | ||
The arrow function in writeToDisk(...) tells the dev server to write | ||
only index.html to the disk. | ||
The indexPath option (see above) instructs Webpack to also rename | ||
index.html to base-vue.html and save it to Django templates folder. | ||
We don't need other assets on the disk (CSS, JS...) - the dev server | ||
can serve them from memory. | ||
See also: | ||
https://cli.vuejs.org/config/#indexpath | ||
https://webpack.js.org/configuration/dev-server/#devserverwritetodisk- | ||
*/ | ||
config.devServer | ||
.public('http://127.0.0.1:8080') | ||
.hotOnly(true) | ||
.headers({"Access-Control-Allow-Origin": "*"}) | ||
.writeToDisk(filePath => filePath.endsWith('index.html')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% block html %} | ||
<!doctype html> | ||
<html {% block html_tag_attributes %}{% endblock %}> | ||
<head> | ||
{% block head %} | ||
<meta charset="utf-8"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<!-- <link rel="icon" href="favicon.ico"> --> | ||
<title>Django + Vue CLI + Webpack demo</title> | ||
{% endblock %} | ||
</head> | ||
<body {% block body_tag_attributes %}{% endblock %}> | ||
{% block body %} | ||
{% block content %}{% endblock %} | ||
{% endblock %} | ||
</body> | ||
</html> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% extends "base-vue.html" %} | ||
|
||
{% block html_tag_attributes %}lang="en"{% endblock %} | ||
|
||
{% block content %} | ||
<noscript> | ||
<strong>Please enable JavaScript to continue.</strong> | ||
</noscript> | ||
|
||
<div id="app"></div> | ||
|
||
<h3 style="margin-top: 4em; text-align: center; font-family: Arial, Helvetica, sans-serif;">Powered by Django!</h3> | ||
{% endblock %} |