A simple module to use webpack in flask projects
tserewara / pywebpack Goto Github PK
View Code? Open in Web Editor NEWA simple module to use webpack in flask projects
A simple module to use webpack in flask projects
In this file:
https://github.com/Tserewara/pywebpack/blob/master/boilerplates/conf.json.ini
On the top we can se the output file using the path
node module to resolve the path to the file.
{ plugins: [new MiniCssExtractPlugin({
filename: 'css/[name].bundle.css'
})],
output: {
filename: 'js/[name].bundle.js',
path: path.join(__dirname, "{blueprint_relative_path}/{blueprint_name}_static/assets"),
},
optimization: {
splitChunks: {
chunks: 'all',
},
},
But in the index
and the module
properties of the object the path is resolved with python. This can lead to inconsistencies when bringing files from the git repo.
entry: {
index: [
'{blueprint_abs_path}/{blueprint_name}_static/src/js/index.js',
'{blueprint_abs_path}/{blueprint_name}_static/src/scss/index.scss'
]
options: {
publicPath: "{blueprint_abs_path}/{blueprint_name}_static/assets/css",
},
The rendered file:
output: {
filename: 'js/bundle.js',
path: path.join(__dirname, "app/bp_one/static_bp_one/assets"),
entry: {
index: [
'C:/Users/shuan/Dropbox/GITHUB/teste_flask/app/bp_one/static_bp_one/src/js/index.js',
It would be better if the path
node module were used on all occurrences
Tests go wrong when pywebpack is used. Must deactivate it to work.
Make it so you can directly load css instead of only scss or sass files in conf.json
Change this:
test: /\.s[ac]ss$/i,
Into this:
test: /\.s[ac]ss|css$/i,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.