Design - MVP - Defaults - Templates
Closed this issue · 0 comments
Scenario (Defaults) ( #4 )
Fixture
webpack.config.js
const MultipageWebpackPlugin = require(multipage-webpack-plugin);
const config = {
entry: {
a: './src/a.js',
b: './src/b.js'
},
output: {
filename: '[name].chunk.js',
path: path.join(__dirname, "dist")
},
module: {
/* ... */
},
plugins: [
new MultipageWebpackPlugin()
]
};
module.exports = config;
Templates
What should we define as the default template output type?
We use the most simple and compatible template across MVC frameworks and that is .html
.
Since under the hood this POC leverages html-webpack-plugin
the output/emitted template file makes sense to be .html. By default there would be automatic handling of where script tags should be placed etc.
What should the default output path and organization (directory structure) for each template?
Each template should be emitted into their own subdirectory inside of the specified path found in config.output.path
. This sub directory by default would be sane to match the entry
name. This way each template can be accessed and served with simple http-server
or liteserver
or whatever else is out there.
Example derived from fixture above:
├── dist/
│ ├── a/
│ ├─── index.html
│ ├── b/
│ ├─── index.html