Skip to content

Commit

Permalink
Merge pull request #21 from tm-kn/chore/fix-static
Browse files Browse the repository at this point in the history
Fix inability to compile static files because of the missing src/ prefix in the paths
  • Loading branch information
tomusher authored Nov 16, 2023
2 parents f067314 + 78a71ee commit 19e73cf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ __pycache__/
devenv.lock
devenv.nix
.env
.DS_Store
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ cd wagtail-ai

With your preferred virtualenv activated, install testing dependencies:

#### Compile front-end assets

```sh
nvm use
npm install
npm run build
```

#### Using pip

```sh
Expand Down
2 changes: 1 addition & 1 deletion tests/testapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
]

STATICFILES_DIRS = [os.path.join(PROJECT_DIR, "static")]
STATICFILES_DIRS = []

STATIC_ROOT = os.path.join(BASE_DIR, "test-static")
STATIC_URL = "/static/"
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"esModuleInterop": true
},
"files": [
"wagtail_ai/static_src/main.tsx",
"wagtail_ai/static_src/custom.d.ts"
"src/wagtail_ai/static_src/main.tsx",
"src/wagtail_ai/static_src/custom.d.ts"
]
}
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const postcssPresetEnv = require('postcss-preset-env');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

module.exports = {
entry: './wagtail_ai/static_src/main.tsx',
entry: './src/wagtail_ai/static_src/main.tsx',
plugins: [new MiniCssExtractPlugin()],
module: {
rules: [
Expand Down Expand Up @@ -49,7 +49,7 @@ module.exports = {
'draft-js': 'DraftJS',
},
output: {
path: path.resolve(__dirname, 'wagtail_ai/static/wagtail_ai'),
path: path.resolve(__dirname, 'src/wagtail_ai/static/wagtail_ai'),
filename: 'wagtail-ai.js',
},
};

0 comments on commit 19e73cf

Please sign in to comment.