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 1 commit
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
8 changes: 6 additions & 2 deletions webpack_tools/management/commands/webpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
class Command(BaseCommand):
help = 'Runs the webpack build...'

packages = [
"stimulus"
]

dev_packages = [
"webpack",
"webpack-cli",
Expand Down Expand Up @@ -72,7 +76,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 +89,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...'))