leitjohn-webpack-starter v1.1.18
Use this to get up and running with webpack
You just need to create a snippet like this in a file called webpack.config.js
configure = require("leitjohn-webpack-starter").configure;
config = configure({
src: "source/",
dest: "../../[django-app]/static/"
});
module.exports = config;
Here are the configuration defaults:
src: "src/" # source files dest: "lib/" # compiled file destination maps: "maps/" # source maps destination www: "www/" # for webpack-dev-server files root styles: "styles/" # if you have styles you'd like to pack too test: "test/" # if you have tests to run templates: "templates/" # if you have nunjucks templates
Bonus! here is an html template for you to drop in www/
<!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">
<title>sample</title>
<link href="bundle.css" rel="stylesheet">
</head>
<body>
<div id="app" class="container">
loading...
</div><!-- /.container -->
<script src="bundle.js"></script>
<script>
window.app = new Main({apiRoot: "http://192.168.10.112:8005/api"});
app.render()
</script>
</body>
</html>
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago