Skip to content

Commit

Permalink
Bundled assets under a single directory
Browse files Browse the repository at this point in the history
  • Loading branch information
khadegd committed Nov 5, 2020
1 parent 173ee80 commit 820b086
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
SECRET_KEY = ')u)=q2gh%++e1!h(q5*+sa^nn8ygszg=dqfr7a!0ogzleh=i6k'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False

ALLOWED_HOSTS = [
'localhost',
Expand Down Expand Up @@ -130,7 +130,7 @@
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'assets/bundles'),
os.path.join(BASE_DIR, 'assets/staticfiles'),
]

WEBPACK_LOADER = {
Expand All @@ -154,7 +154,7 @@
WEBPACK_LOADER.update({
'DEFAULT': {
# 'BUNDLE_DIR_NAME': 'bundles/',
'STATS_FILE': os.path.join(BASE_DIR, 'staticfiles/stats.json')
'STATS_FILE': os.path.join(BASE_DIR, 'staticfiles/bundles/stats.json')
}
})

Expand Down
6 changes: 3 additions & 3 deletions webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ module.exports = merge(common, {
mode: "production",
output: {
filename: "[name].[contenthash].js",
path: path.resolve(__dirname, "./assets/bundles/"),
publicPath: "/static/",
path: path.resolve(__dirname, "./assets/staticfiles/bundles/"),
publicPath: "/static/bundles/",
},
optimization: {
minimizer: [
Expand All @@ -23,7 +23,7 @@ module.exports = merge(common, {
plugins: [
new MiniCssExtractPlugin({ filename: "[name].[contenthash].css" }),
new CleanWebpackPlugin(),
new BundleTracker({path: __dirname, filename: './assets/bundles/stats.json'})
new BundleTracker({path: __dirname, filename: './assets/staticfiles/bundles/stats.json'})
],
module: {
rules: [
Expand Down

0 comments on commit 820b086

Please sign in to comment.