Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Add Stimulus to init installation. #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions webpack_tools/management/commands/webpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
class Command(BaseCommand):
help = 'Runs the webpack build...'

packages = [
"stimulus"
]

dev_packages = [
"glob",
"webpack",
"webpack-cli",
"webpack-bundle-analyzer",
Expand Down Expand Up @@ -72,7 +77,7 @@ def npm_install_dev_dependencies(self, *args, **options):

if options['loop']:
results = {}
for package in self.dev_packages:
for package in self.dev_packages + self.packages:
self.stdout.write(f'Installing package {package}')
response = subprocess.run(["npm", "install", "--save-dev", package])
results.update({package: response})
Expand All @@ -85,6 +90,6 @@ def npm_install_dev_dependencies(self, *args, **options):
self.stdout.write(self.style.WARNING(f'There were errors when installing packages...'))
else:
self.stdout.write(f'Installing all packages at once {self.dev_packages}')
response = subprocess.run(["npm", "install", "--save-dev"] + self.dev_packages)
response = subprocess.run(["npm", "install", "--save-dev"] + (self.dev_packages + self.packages))
if response.returncode != 0:
self.stdout.write(self.style.WARNING(f'There were errors when installing packages...'))