diff --git a/chp/django/example/blog/templates/blog/post_form.html b/chp/django/example/blog/templates/blog/post_form.html index 8cebcaaa6af0dbe86cd75a09dcc8b02fc474f295..0f0ea77f6d391fdd6012e0d58308273086cadfd3 100644 --- a/chp/django/example/blog/templates/blog/post_form.html +++ b/chp/django/example/blog/templates/blog/post_form.html @@ -1,8 +1,7 @@ {% load static %} - - +
@@ -74,6 +73,5 @@
- diff --git a/chp/django/example/main.js b/chp/django/example/main.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..751071f78f91ad46a5be38614d2e7c73da20c7f4 100644 --- a/chp/django/example/main.js +++ b/chp/django/example/main.js @@ -0,0 +1,2 @@ +window.mdc = require('material-components-web'); +window.mdc.autoInit(); diff --git a/chp/django/example/main.scss b/chp/django/example/main.scss new file mode 100644 index 0000000000000000000000000000000000000000..fbf5f89b2a0a93207643fa68fc2d2db32e4152b2 --- /dev/null +++ b/chp/django/example/main.scss @@ -0,0 +1 @@ +@import "material-components-web/material-components-web"; diff --git a/chp/django/example/package.json b/chp/django/example/package.json index 4bb9c8edce040938e3a43410367c2c042d1a8d42..2ee918151828c4ee64623eb606b8c89ff2d979da 100644 --- a/chp/django/example/package.json +++ b/chp/django/example/package.json @@ -9,8 +9,12 @@ }, "dependencies": { "autoprefixer": "^9.1.5", + "css-loader": "^2.1.0", "extract-text-webpack-plugin": "^4.0.0-beta.0", "material-components-web": "^0.39.1", + "node-sass": "^4.11.0", + "postcss-loader": "^3.0.0", + "sass-loader": "^7.1.0", "webpack": "^4.16.1", "webpack-cli": "^3.1.0" }, diff --git a/chp/django/example/webpack.config.js b/chp/django/example/webpack.config.js index 3be183ea1583c01569bab13559b22a5f4089ea3f..0d44e0f9be495f7da919c4c6ace41bf5ad9159de 100644 --- a/chp/django/example/webpack.config.js +++ b/chp/django/example/webpack.config.js @@ -1,14 +1,14 @@ -const autoprefixer = require('autoprefixer') -const ExtractTextPlugin = require('extract-text-webpack-plugin') -var path = require('path') +const autoprefixer = require('autoprefixer'); +const ExtractTextPlugin = require('extract-text-webpack-plugin'); +var path = require('path'); const extractSass = new ExtractTextPlugin({ - filename: 'main.css', -}) + filename: 'output.css', +}); module.exports = { mode: 'development', devtool: 'source-map', - entry: './main.js', + entry: ['./main.js', './main.scss'], output: { filename: 'output.js', path: path.resolve(__dirname, 'blog/static') @@ -20,8 +20,12 @@ module.exports = { // }, module: { rules: [ - { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' }, - { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' }, + { + test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, + loader: 'url-loader?limit=10000&mimetype=application/font-woff' }, + { + test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, + loader: 'file-loader' }, { test: /\.py$/, loader: 'py-loader', @@ -43,14 +47,16 @@ module.exports = { loader: 'postcss-loader', options: { sourceMap: true, - plugins: () => [autoprefixer()] + plugins: () => [autoprefixer({grid: false})] } }, { loader: 'sass-loader', options: { sourceMap: true, - includePaths: ['./node_modules'] + includePaths: [ + path.resolve(__dirname, 'node_modules') + ] } } ] @@ -61,4 +67,4 @@ module.exports = { plugins: [ extractSass ] -} +};