diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-10-23 11:09:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 11:09:17 +0200 |
commit | 1953a872932a63792293b4aec087880265ba89f7 (patch) | |
tree | fd16599e737fcdaf193c933ef3ec4a4ee248b117 /app/config | |
parent | d83d25dadec2c38460a32d96f5d2903426fec9d3 (diff) | |
parent | 702f2d67d60ca963492b90dad74cb5f8dcc84e51 (diff) | |
download | wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.gz wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.zst wallabag-1953a872932a63792293b4aec087880265ba89f7.zip |
Merge pull request #3011 from wallabag/2.3
wallabag 2.3.0
Diffstat (limited to 'app/config')
-rw-r--r-- | app/config/config.yml | 55 | ||||
-rw-r--r-- | app/config/config_dev.yml | 2 | ||||
-rw-r--r-- | app/config/config_prod.yml | 6 | ||||
-rw-r--r-- | app/config/config_test.yml | 3 | ||||
-rw-r--r-- | app/config/parameters.yml.dist | 16 | ||||
-rw-r--r-- | app/config/parameters_test.yml | 3 | ||||
-rw-r--r-- | app/config/security.yml | 2 | ||||
-rw-r--r-- | app/config/services.yml | 8 | ||||
-rw-r--r-- | app/config/tests/parameters_test.mysql.yml | 1 | ||||
-rw-r--r-- | app/config/tests/parameters_test.pgsql.yml | 1 | ||||
-rw-r--r-- | app/config/tests/parameters_test.sqlite.yml | 5 | ||||
-rw-r--r-- | app/config/wallabag.yml | 162 | ||||
-rw-r--r-- | app/config/webpack/common.js | 40 | ||||
-rw-r--r-- | app/config/webpack/dev.js | 61 | ||||
-rw-r--r-- | app/config/webpack/prod.js | 111 |
15 files changed, 423 insertions, 53 deletions
diff --git a/app/config/config.yml b/app/config/config.yml index 77cda052..08da4f8f 100644 --- a/app/config/config.yml +++ b/app/config/config.yml | |||
@@ -2,6 +2,12 @@ imports: | |||
2 | - { resource: parameters.yml } | 2 | - { resource: parameters.yml } |
3 | - { resource: security.yml } | 3 | - { resource: security.yml } |
4 | - { resource: services.yml } | 4 | - { resource: services.yml } |
5 | - { resource: wallabag.yml } | ||
6 | |||
7 | parameters: | ||
8 | # Allows to use the live reload feature for changes in assets | ||
9 | use_webpack_dev_server: false | ||
10 | craue_config.cache_adapter.class: Craue\ConfigBundle\CacheAdapter\SymfonyCacheComponentAdapter | ||
5 | 11 | ||
6 | framework: | 12 | framework: |
7 | #esi: ~ | 13 | #esi: ~ |
@@ -10,7 +16,7 @@ framework: | |||
10 | fallback: "%locale%" | 16 | fallback: "%locale%" |
11 | secret: "%secret%" | 17 | secret: "%secret%" |
12 | router: | 18 | router: |
13 | resource: "%kernel.root_dir%/config/routing.yml" | 19 | resource: "%kernel.project_dir%/app/config/routing.yml" |
14 | strict_requirements: ~ | 20 | strict_requirements: ~ |
15 | form: ~ | 21 | form: ~ |
16 | csrf_protection: ~ | 22 | csrf_protection: ~ |
@@ -24,45 +30,11 @@ framework: | |||
24 | session: | 30 | session: |
25 | # handler_id set to null will use default session handler from php.ini | 31 | # handler_id set to null will use default session handler from php.ini |
26 | handler_id: session.handler.native_file | 32 | handler_id: session.handler.native_file |
27 | save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%" | 33 | save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%" |
28 | fragments: ~ | 34 | fragments: ~ |
29 | http_method_override: true | 35 | http_method_override: true |
30 | assets: ~ | 36 | assets: ~ |
31 | 37 | ||
32 | wallabag_core: | ||
33 | version: 2.2.3 | ||
34 | paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb" | ||
35 | languages: | ||
36 | en: 'English' | ||
37 | fr: 'Français' | ||
38 | de: 'Deutsch' | ||
39 | tr: 'Türkçe' | ||
40 | fa: 'فارسی' | ||
41 | ro: 'Română' | ||
42 | pl: 'Polish' | ||
43 | da: 'Dansk' | ||
44 | es: 'Español' | ||
45 | oc: 'Occitan' | ||
46 | it: 'Italiano' | ||
47 | pt: 'Português' | ||
48 | items_on_page: 12 | ||
49 | theme: material | ||
50 | language: '%locale%' | ||
51 | rss_limit: 50 | ||
52 | reading_speed: 1 | ||
53 | cache_lifetime: 10 | ||
54 | action_mark_as_read: 1 | ||
55 | list_mode: 1 | ||
56 | fetching_error_message: | | ||
57 | wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>. | ||
58 | |||
59 | wallabag_user: | ||
60 | registration_enabled: "%fosuser_registration%" | ||
61 | |||
62 | wallabag_import: | ||
63 | allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv'] | ||
64 | resource_dir: "%kernel.root_dir%/../web/uploads/import" | ||
65 | |||
66 | # Twig Configuration | 38 | # Twig Configuration |
67 | twig: | 39 | twig: |
68 | debug: "%kernel.debug%" | 40 | debug: "%kernel.debug%" |
@@ -100,7 +72,7 @@ stof_doctrine_extensions: | |||
100 | sluggable: true | 72 | sluggable: true |
101 | 73 | ||
102 | doctrine_migrations: | 74 | doctrine_migrations: |
103 | dir_name: "%kernel.root_dir%/DoctrineMigrations" | 75 | dir_name: "%kernel.project_dir%/app/DoctrineMigrations" |
104 | namespace: Application\Migrations | 76 | namespace: Application\Migrations |
105 | table_name: migration_versions | 77 | table_name: migration_versions |
106 | name: Application Migrations | 78 | name: Application Migrations |
@@ -138,7 +110,7 @@ fos_rest: | |||
138 | epub: true | 110 | epub: true |
139 | mobi: true | 111 | mobi: true |
140 | templating_formats: | 112 | templating_formats: |
141 | html: true | 113 | html: false |
142 | force_redirects: | 114 | force_redirects: |
143 | html: true | 115 | html: true |
144 | failed_validation: HTTP_BAD_REQUEST | 116 | failed_validation: HTTP_BAD_REQUEST |
@@ -378,3 +350,10 @@ fos_js_routing: | |||
378 | - howto | 350 | - howto |
379 | - fos_user_security_logout | 351 | - fos_user_security_logout |
380 | - new | 352 | - new |
353 | |||
354 | jms_serializer: | ||
355 | handlers: | ||
356 | # to be removed if we switch to (default) ISO8601 datetime instead of ATOM | ||
357 | # see: https://github.com/schmittjoh/JMSSerializerBundle/pull/494 | ||
358 | datetime: | ||
359 | default_format: "Y-m-d\\TH:i:sO" # ATOM | ||
diff --git a/app/config/config_dev.yml b/app/config/config_dev.yml index 3b67d8f6..0c490575 100644 --- a/app/config/config_dev.yml +++ b/app/config/config_dev.yml | |||
@@ -3,7 +3,7 @@ imports: | |||
3 | 3 | ||
4 | framework: | 4 | framework: |
5 | router: | 5 | router: |
6 | resource: "%kernel.root_dir%/config/routing_dev.yml" | 6 | resource: "%kernel.project_dir%/app/config/routing_dev.yml" |
7 | strict_requirements: true | 7 | strict_requirements: true |
8 | profiler: | 8 | profiler: |
9 | only_exceptions: false | 9 | only_exceptions: false |
diff --git a/app/config/config_prod.yml b/app/config/config_prod.yml index 5a4dd69e..44e29aac 100644 --- a/app/config/config_prod.yml +++ b/app/config/config_prod.yml | |||
@@ -1,9 +1,9 @@ | |||
1 | imports: | 1 | imports: |
2 | - { resource: config.yml } | 2 | - { resource: config.yml } |
3 | 3 | ||
4 | #framework: | 4 | framework: |
5 | # cache: | 5 | assets: |
6 | # system: cache.adapter.apcu | 6 | # json_manifest_path: '%kernel.project_dir%/web/bundles/wallabagcore/manifest.json' |
7 | 7 | ||
8 | #doctrine: | 8 | #doctrine: |
9 | # orm: | 9 | # orm: |
diff --git a/app/config/config_test.yml b/app/config/config_test.yml index f5e2c25e..c620c359 100644 --- a/app/config/config_test.yml +++ b/app/config/config_test.yml | |||
@@ -29,7 +29,8 @@ doctrine: | |||
29 | user: "%test_database_user%" | 29 | user: "%test_database_user%" |
30 | password: "%test_database_password%" | 30 | password: "%test_database_password%" |
31 | charset: "%test_database_charset%" | 31 | charset: "%test_database_charset%" |
32 | path: "%test_database_path%" | 32 | path: "%env(TEST_DATABASE_PATH)%" |
33 | |||
33 | orm: | 34 | orm: |
34 | metadata_cache_driver: | 35 | metadata_cache_driver: |
35 | type: service | 36 | type: service |
diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 97f51ed1..b5b97950 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist | |||
@@ -10,17 +10,20 @@ parameters: | |||
10 | # database_user: %env.database_user% | 10 | # database_user: %env.database_user% |
11 | # database_password: %env.database_password% | 11 | # database_password: %env.database_password% |
12 | 12 | ||
13 | database_driver: pdo_sqlite | 13 | database_driver: pdo_mysql |
14 | database_host: 127.0.0.1 | 14 | database_host: 127.0.0.1 |
15 | database_port: ~ | 15 | database_port: ~ |
16 | database_name: symfony | 16 | database_name: wallabag |
17 | database_user: root | 17 | database_user: root |
18 | database_password: ~ | 18 | database_password: ~ |
19 | database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite" | 19 | # For SQLite, database_path should be "%kernel.project_dir%/data/db/wallabag.sqlite" |
20 | database_path: null | ||
20 | database_table_prefix: wallabag_ | 21 | database_table_prefix: wallabag_ |
21 | database_socket: null | 22 | database_socket: null |
22 | # with MySQL, use "utf8mb4" if you got problem with content with emojis | 23 | # with PostgreSQL and SQLite, you must set "utf8" |
23 | database_charset: utf8 | 24 | database_charset: utf8mb4 |
25 | |||
26 | domain_name: https://your-wallabag-url-instance.com | ||
24 | 27 | ||
25 | mailer_transport: smtp | 28 | mailer_transport: smtp |
26 | mailer_host: 127.0.0.1 | 29 | mailer_host: 127.0.0.1 |
@@ -57,6 +60,3 @@ parameters: | |||
57 | redis_port: 6379 | 60 | redis_port: 6379 |
58 | redis_path: null | 61 | redis_path: null |
59 | redis_password: null | 62 | redis_password: null |
60 | |||
61 | # sites credentials | ||
62 | sites_credentials: {} | ||
diff --git a/app/config/parameters_test.yml b/app/config/parameters_test.yml index 5f2e25bb..257d2ace 100644 --- a/app/config/parameters_test.yml +++ b/app/config/parameters_test.yml | |||
@@ -5,5 +5,6 @@ parameters: | |||
5 | test_database_name: null | 5 | test_database_name: null |
6 | test_database_user: null | 6 | test_database_user: null |
7 | test_database_password: null | 7 | test_database_password: null |
8 | test_database_path: '%kernel.root_dir%/../data/db/wallabag_test.sqlite' | 8 | test_database_path: "%env(TEST_DATABASE_PATH)%" |
9 | env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite" | ||
9 | test_database_charset: utf8 | 10 | test_database_charset: utf8 |
diff --git a/app/config/security.yml b/app/config/security.yml index efb00a53..e14a0bd1 100644 --- a/app/config/security.yml +++ b/app/config/security.yml | |||
@@ -56,10 +56,12 @@ security: | |||
56 | access_control: | 56 | access_control: |
57 | - { path: ^/api/doc, roles: IS_AUTHENTICATED_ANONYMOUSLY } | 57 | - { path: ^/api/doc, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
58 | - { path: ^/api/version, roles: IS_AUTHENTICATED_ANONYMOUSLY } | 58 | - { path: ^/api/version, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
59 | - { path: ^/api/user, roles: IS_AUTHENTICATED_ANONYMOUSLY } | ||
59 | - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY } | 60 | - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
60 | - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } | 61 | - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } |
61 | - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } | 62 | - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } |
62 | - { path: /(unread|starred|archive).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } | 63 | - { path: /(unread|starred|archive).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
64 | - { path: /tags/(.*).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } | ||
63 | - { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY } | 65 | - { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
64 | - { path: ^/settings, roles: ROLE_SUPER_ADMIN } | 66 | - { path: ^/settings, roles: ROLE_SUPER_ADMIN } |
65 | - { path: ^/annotations, roles: ROLE_USER } | 67 | - { path: ^/annotations, roles: ROLE_USER } |
diff --git a/app/config/services.yml b/app/config/services.yml index 9a1ce80b..7b85d846 100644 --- a/app/config/services.yml +++ b/app/config/services.yml | |||
@@ -42,3 +42,11 @@ services: | |||
42 | arguments: ["@session"] | 42 | arguments: ["@session"] |
43 | tags: | 43 | tags: |
44 | - { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin } | 44 | - { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin } |
45 | |||
46 | craue_config_cache_provider: | ||
47 | class: Symfony\Component\Cache\Adapter\FilesystemAdapter | ||
48 | public: false | ||
49 | arguments: | ||
50 | - 'craue_config' | ||
51 | - 0 | ||
52 | - '%kernel.cache_dir%' | ||
diff --git a/app/config/tests/parameters_test.mysql.yml b/app/config/tests/parameters_test.mysql.yml index bca2d466..36b227fb 100644 --- a/app/config/tests/parameters_test.mysql.yml +++ b/app/config/tests/parameters_test.mysql.yml | |||
@@ -6,4 +6,5 @@ parameters: | |||
6 | test_database_user: root | 6 | test_database_user: root |
7 | test_database_password: ~ | 7 | test_database_password: ~ |
8 | test_database_path: ~ | 8 | test_database_path: ~ |
9 | env(TEST_DATABASE_PATH): ~ | ||
9 | test_database_charset: utf8mb4 | 10 | test_database_charset: utf8mb4 |
diff --git a/app/config/tests/parameters_test.pgsql.yml b/app/config/tests/parameters_test.pgsql.yml index 3e18d4a0..60f51df6 100644 --- a/app/config/tests/parameters_test.pgsql.yml +++ b/app/config/tests/parameters_test.pgsql.yml | |||
@@ -6,4 +6,5 @@ parameters: | |||
6 | test_database_user: travis | 6 | test_database_user: travis |
7 | test_database_password: ~ | 7 | test_database_password: ~ |
8 | test_database_path: ~ | 8 | test_database_path: ~ |
9 | env(TEST_DATABASE_PATH): ~ | ||
9 | test_database_charset: utf8 | 10 | test_database_charset: utf8 |
diff --git a/app/config/tests/parameters_test.sqlite.yml b/app/config/tests/parameters_test.sqlite.yml index b8a5f41a..2b92d579 100644 --- a/app/config/tests/parameters_test.sqlite.yml +++ b/app/config/tests/parameters_test.sqlite.yml | |||
@@ -5,5 +5,8 @@ parameters: | |||
5 | test_database_name: ~ | 5 | test_database_name: ~ |
6 | test_database_user: ~ | 6 | test_database_user: ~ |
7 | test_database_password: ~ | 7 | test_database_password: ~ |
8 | test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite" | 8 | # Using an environnement variable in order to avoid the error "attempt to write a readonly database" |
9 | # when the schema is dropped then recreate | ||
10 | test_database_path: "%env(TEST_DATABASE_PATH)%" | ||
11 | env(TEST_DATABASE_PATH): "%kernel.project_dir%/data/db/wallabag_test.sqlite" | ||
9 | test_database_charset: utf8 | 12 | test_database_charset: utf8 |
diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml new file mode 100644 index 00000000..bbc587b0 --- /dev/null +++ b/app/config/wallabag.yml | |||
@@ -0,0 +1,162 @@ | |||
1 | wallabag_core: | ||
2 | version: 2.3.0 | ||
3 | paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb" | ||
4 | languages: | ||
5 | en: 'English' | ||
6 | fr: 'Français' | ||
7 | de: 'Deutsch' | ||
8 | tr: 'Türkçe' | ||
9 | fa: 'فارسی' | ||
10 | ro: 'Română' | ||
11 | pl: 'Polish' | ||
12 | da: 'Dansk' | ||
13 | es: 'Español' | ||
14 | oc: 'Occitan' | ||
15 | it: 'Italiano' | ||
16 | pt: 'Português' | ||
17 | ru: 'Русский' | ||
18 | items_on_page: 12 | ||
19 | theme: material | ||
20 | language: '%locale%' | ||
21 | rss_limit: 50 | ||
22 | reading_speed: 1 | ||
23 | cache_lifetime: 10 | ||
24 | action_mark_as_read: 1 | ||
25 | list_mode: 0 | ||
26 | fetching_error_message_title: 'No title found' | ||
27 | fetching_error_message: | | ||
28 | wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>. | ||
29 | api_limit_mass_actions: 10 | ||
30 | encryption_key_path: "%kernel.project_dir%/data/site-credentials-secret-key.txt" | ||
31 | default_internal_settings: | ||
32 | - | ||
33 | name: share_public | ||
34 | value: 1 | ||
35 | section: entry | ||
36 | - | ||
37 | name: carrot | ||
38 | value: 1 | ||
39 | section: entry | ||
40 | - | ||
41 | name: share_diaspora | ||
42 | value: 1 | ||
43 | section: entry | ||
44 | - | ||
45 | name: diaspora_url | ||
46 | value: http://diasporapod.com | ||
47 | section: entry | ||
48 | - | ||
49 | name: share_unmark | ||
50 | value: 1 | ||
51 | section: entry | ||
52 | - | ||
53 | name: unmark_url | ||
54 | value: https://unmark.it | ||
55 | section: entry | ||
56 | - | ||
57 | name: share_shaarli | ||
58 | value: 1 | ||
59 | section: entry | ||
60 | - | ||
61 | name: share_scuttle | ||
62 | value: 1 | ||
63 | section: entry | ||
64 | - | ||
65 | name: shaarli_url | ||
66 | value: http://myshaarli.com | ||
67 | section: entry | ||
68 | - | ||
69 | name: scuttle_url | ||
70 | value: http://scuttle.org | ||
71 | section: entry | ||
72 | - | ||
73 | name: share_mail | ||
74 | value: 1 | ||
75 | section: entry | ||
76 | - | ||
77 | name: share_twitter | ||
78 | value: 1 | ||
79 | section: entry | ||
80 | - | ||
81 | name: show_printlink | ||
82 | value: 1 | ||
83 | section: entry | ||
84 | - | ||
85 | name: restricted_access | ||
86 | value: 0 | ||
87 | section: entry | ||
88 | - | ||
89 | name: export_epub | ||
90 | value: 1 | ||
91 | section: export | ||
92 | - | ||
93 | name: export_mobi | ||
94 | value: 1 | ||
95 | section: export | ||
96 | - | ||
97 | name: export_pdf | ||
98 | value: 1 | ||
99 | section: export | ||
100 | - | ||
101 | name: export_csv | ||
102 | value: 1 | ||
103 | section: export | ||
104 | - | ||
105 | name: export_json | ||
106 | value: 1 | ||
107 | section: export | ||
108 | - | ||
109 | name: export_txt | ||
110 | value: 1 | ||
111 | section: export | ||
112 | - | ||
113 | name: export_xml | ||
114 | value: 1 | ||
115 | section: export | ||
116 | - | ||
117 | name: import_with_redis | ||
118 | value: 0 | ||
119 | section: import | ||
120 | - | ||
121 | name: import_with_rabbitmq | ||
122 | value: 0 | ||
123 | section: import | ||
124 | - | ||
125 | name: piwik_enabled | ||
126 | value: 0 | ||
127 | section: analytics | ||
128 | - | ||
129 | name: piwik_host | ||
130 | value: v2.wallabag.org | ||
131 | section: analytics | ||
132 | - | ||
133 | name: piwik_site_id | ||
134 | value: 1 | ||
135 | section: analytics | ||
136 | - | ||
137 | name: demo_mode_enabled | ||
138 | value: 0 | ||
139 | section: misc | ||
140 | - | ||
141 | name: demo_mode_username | ||
142 | value: wallabag | ||
143 | section: misc | ||
144 | - | ||
145 | name: download_images_enabled | ||
146 | value: 0 | ||
147 | section: misc | ||
148 | - | ||
149 | name: wallabag_support_url | ||
150 | value: https://www.wallabag.org/pages/support.html | ||
151 | section: misc | ||
152 | - | ||
153 | name: api_user_registration | ||
154 | value: 0 | ||
155 | section: api | ||
156 | |||
157 | wallabag_user: | ||
158 | registration_enabled: "%fosuser_registration%" | ||
159 | |||
160 | wallabag_import: | ||
161 | allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv'] | ||
162 | resource_dir: "%kernel.project_dir%/web/uploads/import" | ||
diff --git a/app/config/webpack/common.js b/app/config/webpack/common.js new file mode 100644 index 00000000..c497689a --- /dev/null +++ b/app/config/webpack/common.js | |||
@@ -0,0 +1,40 @@ | |||
1 | const path = require('path'); | ||
2 | const webpack = require('webpack'); | ||
3 | const StyleLintPlugin = require('stylelint-webpack-plugin'); | ||
4 | |||
5 | const rootDir = path.resolve(__dirname, '../../../'); | ||
6 | |||
7 | module.exports = function () { | ||
8 | return { | ||
9 | entry: { | ||
10 | material: path.join(rootDir, './app/Resources/static/themes/material/index.js'), | ||
11 | baggy: path.join(rootDir, './app/Resources/static/themes/baggy/index.js'), | ||
12 | public: path.join(rootDir, './app/Resources/static/themes/_global/share.js'), | ||
13 | }, | ||
14 | output: { | ||
15 | filename: '[name].js', | ||
16 | path: path.resolve(rootDir, 'web/bundles/wallabagcore'), | ||
17 | publicPath: '/bundles/wallabagcore/', | ||
18 | }, | ||
19 | plugins: [ | ||
20 | new webpack.ProvidePlugin({ | ||
21 | $: 'jquery', | ||
22 | jQuery: 'jquery', | ||
23 | 'window.$': 'jquery', | ||
24 | 'window.jQuery': 'jquery', | ||
25 | }), | ||
26 | new StyleLintPlugin({ | ||
27 | configFile: '.stylelintrc', | ||
28 | failOnError: false, | ||
29 | quiet: false, | ||
30 | context: 'app/Resources/static/themes', | ||
31 | files: '**/*.scss', | ||
32 | }), | ||
33 | ], | ||
34 | resolve: { | ||
35 | alias: { | ||
36 | jquery: path.join(rootDir, 'node_modules/jquery/dist/jquery.js'), | ||
37 | }, | ||
38 | }, | ||
39 | }; | ||
40 | }; | ||
diff --git a/app/config/webpack/dev.js b/app/config/webpack/dev.js new file mode 100644 index 00000000..97abc5eb --- /dev/null +++ b/app/config/webpack/dev.js | |||
@@ -0,0 +1,61 @@ | |||
1 | const webpackMerge = require('webpack-merge'); | ||
2 | const webpack = require('webpack'); | ||
3 | const commonConfig = require('./common.js'); | ||
4 | |||
5 | module.exports = function () { | ||
6 | return webpackMerge(commonConfig(), { | ||
7 | devtool: 'eval-source-map', | ||
8 | output: { | ||
9 | filename: '[name].dev.js', | ||
10 | }, | ||
11 | |||
12 | devServer: { | ||
13 | hot: true, | ||
14 | // enable HMR on the server | ||
15 | |||
16 | contentBase: './web', | ||
17 | // match the output path | ||
18 | }, | ||
19 | plugins: [ | ||
20 | new webpack.HotModuleReplacementPlugin(), | ||
21 | ], | ||
22 | module: { | ||
23 | rules: [ | ||
24 | { | ||
25 | enforce: 'pre', | ||
26 | test: /\.js$/, | ||
27 | loader: 'eslint-loader', | ||
28 | exclude: /node_modules/, | ||
29 | }, | ||
30 | { | ||
31 | test: /\.js$/, | ||
32 | exclude: /(node_modules)/, | ||
33 | use: { | ||
34 | loader: 'babel-loader', | ||
35 | options: { | ||
36 | presets: ['env'], | ||
37 | }, | ||
38 | }, | ||
39 | }, | ||
40 | { | ||
41 | test: /\.(s)?css$/, | ||
42 | use: [ | ||
43 | 'style-loader', | ||
44 | { | ||
45 | loader: 'css-loader', | ||
46 | options: { | ||
47 | importLoaders: 1, | ||
48 | }, | ||
49 | }, | ||
50 | 'postcss-loader', | ||
51 | 'sass-loader', | ||
52 | ], | ||
53 | }, | ||
54 | { | ||
55 | test: /\.(jpg|png|gif|svg|ico|eot|ttf|woff|woff2)$/, | ||
56 | use: 'url-loader', | ||
57 | }, | ||
58 | ], | ||
59 | }, | ||
60 | }); | ||
61 | }; | ||
diff --git a/app/config/webpack/prod.js b/app/config/webpack/prod.js new file mode 100644 index 00000000..17b8c384 --- /dev/null +++ b/app/config/webpack/prod.js | |||
@@ -0,0 +1,111 @@ | |||
1 | const webpack = require('webpack'); | ||
2 | const webpackMerge = require('webpack-merge'); | ||
3 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
4 | const ManifestPlugin = require('webpack-manifest-plugin'); | ||
5 | |||
6 | const commonConfig = require('./common.js'); | ||
7 | |||
8 | module.exports = function () { | ||
9 | return webpackMerge(commonConfig(), { | ||
10 | output: { | ||
11 | filename: '[name].js', | ||
12 | }, | ||
13 | devtool: 'source-map', | ||
14 | plugins: [ | ||
15 | new webpack.DefinePlugin({ | ||
16 | 'process.env': { | ||
17 | 'NODE_ENV': JSON.stringify('production'), | ||
18 | }, | ||
19 | }), | ||
20 | new webpack.optimize.UglifyJsPlugin({ | ||
21 | beautify: false, | ||
22 | mangle: { | ||
23 | screw_ie8: true, | ||
24 | keep_fnames: true, | ||
25 | }, | ||
26 | compress: { | ||
27 | screw_ie8: true, | ||
28 | warnings: false, | ||
29 | }, | ||
30 | comments: false, | ||
31 | }), | ||
32 | new ExtractTextPlugin('[name].css'), | ||
33 | new ManifestPlugin({ | ||
34 | fileName: 'manifest.json', | ||
35 | }), | ||
36 | ], | ||
37 | module: { | ||
38 | rules: [ | ||
39 | { | ||
40 | enforce: 'pre', | ||
41 | test: /\.js$/, | ||
42 | loader: 'eslint-loader', | ||
43 | exclude: /node_modules/, | ||
44 | }, | ||
45 | { | ||
46 | test: /\.js$/, | ||
47 | exclude: /(node_modules)/, | ||
48 | use: { | ||
49 | loader: 'babel-loader', | ||
50 | options: { | ||
51 | presets: ['env'], | ||
52 | }, | ||
53 | }, | ||
54 | }, | ||
55 | { | ||
56 | test: /\.(s)?css$/, | ||
57 | use: ExtractTextPlugin.extract({ | ||
58 | fallback: 'style-loader', | ||
59 | use: [ | ||
60 | { | ||
61 | loader: 'css-loader', | ||
62 | options: { | ||
63 | importLoaders: 1, | ||
64 | minimize: { | ||
65 | discardComments: { | ||
66 | removeAll: true, | ||
67 | }, | ||
68 | core: true, | ||
69 | minifyFontValues: true, | ||
70 | }, | ||
71 | }, | ||
72 | }, | ||
73 | 'postcss-loader', | ||
74 | 'sass-loader', | ||
75 | ], | ||
76 | }), | ||
77 | }, | ||
78 | { | ||
79 | test: /\.(jpg|png|gif|svg|ico)$/, | ||
80 | include: /node_modules/, | ||
81 | use: { | ||
82 | loader: 'file-loader', | ||
83 | options: { | ||
84 | name: 'img/[name].[ext]', | ||
85 | }, | ||
86 | }, | ||
87 | }, | ||
88 | { | ||
89 | test: /\.(jpg|png|gif|svg|ico)$/, | ||
90 | exclude: /node_modules/, | ||
91 | use: { | ||
92 | loader: 'file-loader', | ||
93 | options: { | ||
94 | context: 'app/Resources/static', | ||
95 | name: '[path][name].[ext]', | ||
96 | }, | ||
97 | }, | ||
98 | }, | ||
99 | { | ||
100 | test: /\.(eot|ttf|woff|woff2)$/, | ||
101 | use: { | ||
102 | loader: 'file-loader', | ||
103 | options: { | ||
104 | name: 'fonts/[name].[ext]', | ||
105 | }, | ||
106 | }, | ||
107 | }, | ||
108 | ], | ||
109 | }, | ||
110 | }); | ||
111 | }; | ||