Commit Graph

100 Commits

Author SHA1 Message Date
Shamoil Arsiwala 9291137527 fix: allow DefinePlugin shorthand property 2023-05-20 14:32:09 +05:30
alexander.akait 7a608967fa feat: added logging to define plugin 2023-04-23 21:42:05 +03:00
Ivan Kopeykin 45754f45d0 rename some properties, add more test cases 2023-04-09 10:44:09 +03:00
Ivan Kopeykin 9bb35fb998 support destructuring assignment in parser 2023-04-07 22:29:32 +03:00
Sean Larkin 4bcc0f0ed5 yarn lint fix 2023-03-31 09:45:36 -07:00
Sean Larkin 844fc55b36 refactor(moduletypes): introduce module type constants, reduce memory footprint define/json plugins 2023-03-31 09:26:38 -07:00
Ivan Kopeykin 27411f8f0f add pure notations to Object calls
/*#__PURE__*/ notations should help minimizers to drop unused Object(...) calls
2021-10-17 11:06:14 +03:00
Tobias Koppers ebc2551060 give DefinePlugin a different key to avoid conflicting with different variants of it 2021-10-04 09:01:00 +02:00
Tobias Koppers 5f22bffdd1 use a hash instead of a list to track DefinePlugin dependency 2021-09-29 15:01:31 +02:00
Tobias Koppers b0fa9ccada pretty files 2021-05-11 09:31:46 +02:00
Tobias Koppers 33b44a05ea DefinePlugin invalidates modules when new defines are added
fixes https://github.com/vercel/next.js/issues/23901
2021-04-12 12:23:51 +02:00
Tobias Koppers 103a51468b DefinePlugin takes care of module invalidation when values have changed
The options of the DefinePlugin no longer have to be covered by build dependencies
2021-03-15 15:19:42 +01:00
Tobias Koppers 48010fb955 replace output.ecmaVersion with output.environment and more detailed flags 2020-09-10 11:12:28 +02:00
Tobias Koppers 962199c288 nitpicks 2020-09-01 11:15:52 +02:00
Ivan Kopeykin 35c56e67ae refactor how asi handled
- add asiSafeExpression helper for JavascriptParser
- use asiSafe flag in DefinePlugin
- try to use (...) instead of Object()
2020-08-28 19:46:56 +03:00
Tobias Koppers cee47dc867 Store cache dependencies inside of Snapshot to reduce cache size 2020-08-24 18:16:54 +02:00
Tobias Koppers c8aff62228 improve handling of side effects with evaluation 2020-07-21 13:00:25 +02:00
Tobias Koppers b9c50fdb09 fix jsdoc documentations 2020-04-28 19:42:58 +02:00
Tobias Koppers 3f9e6d5ec6 move tooling into separate repo, add type generation and test types 2020-04-21 09:25:38 +02:00
Tobias Koppers 994b47faa6 formating, use real big number 2020-03-09 10:59:31 +01:00
evilebottnawi 09197da090 feat: `bigint` for the `DefinePlugin` plugin 2020-03-09 10:57:22 +01:00
evilebottnawi 784ff508d0 feat: `bigint` for the `DefinePlugin` plugin 2020-03-09 10:57:14 +01:00
evilebottnawi 1308ae7e8e feat: `bigint` for the `DefinePlugin` plugin 2020-03-09 10:57:05 +01:00
evilebottnawi f4ba449130 fix: negative zero for DefinePlugin 2020-03-02 16:49:59 +03:00
Tobias Koppers d426b6c679
Merge pull request #9942 from mattp94/feat/array-support
feat(DefinePlugin): Support array as value in DefinePlugin
2020-02-12 13:37:39 +01:00
Albus Dumbledore 37e0a1217f
Fix branding violation 2020-02-09 13:37:46 +05:30
mattp94 684c57fdc1 fix(DefinePlugin): Prevent an ambiguous syntax by wrapping array with Object 2019-11-12 23:58:00 +01:00
mattp94 28fb5a80e6 feat(DefinePlugin): Support array as value in DefinePlugin 2019-11-08 13:31:06 +01:00
Tobias Koppers acff6ec992 move BasicEvaluatedExpression and JavascriptParserHelpers to javascript directory 2019-10-22 09:27:52 +02:00
evilebottnawi 8198ffb3e6 refactor: code 2019-10-22 00:14:05 +02:00
Tobias Koppers f45ba2408e remove items from runtime when unneeded
remove some hooks from MainTemplate, move some hooks to CompatRuntimeModule
add requireScope RuntimeGlobal
2019-10-08 23:46:23 +02:00
Tobias Koppers 3cbdb703fc NullFactory is not required 2019-08-07 16:14:03 +02:00
Tobias Koppers e4d1a45c8d Use FileSystemInfo.createSnapshot for NormalModules too 2019-01-09 14:42:57 +01:00
Tobias Koppers 0232674f9c Initial runtime module work 2018-11-29 16:03:32 +01:00
Tobias Koppers 31e189fcde Merge tag 'v4.24.0' into next
4.24.0
2018-11-02 18:02:39 +01:00
Tobias Koppers 7dc8e519f9
pass { module } instead of module
Co-Authored-By: FranckFreiburger <FranckFreiburger@users.noreply.github.com>
2018-10-31 09:21:03 +01:00
Franck Freiburger 2b0025af35
add module argument to DefinePlugin.runtimeValue functions
PR #6793 added the ability for DefinePlugin to use function that return values.
This PR just add the ability to these functions to access the module being parsed (see #8301).
eg.
```
  webpack.DefinePlugin.runtimeValue(module => module.resource ....)
```
2018-10-30 16:11:33 +01:00
Sergey Melyukov dae811b083 DefinePlugin: reevaluate runtime values on watch mode when fileDependecies is true
closes #7717
2018-10-24 22:35:08 +03:00
Tobias Koppers cf5f1d723c format existing code 2018-07-30 21:29:21 +02:00
Tobias Koppers 249e7d56bb fix merge issue 2018-07-17 11:32:15 +02:00
Tobias Koppers 86ff1a4642 Merge tag 'v4.16.1' into next
4.16.1
2018-07-16 10:30:31 +02:00
Mohsen Azimi c3c4494a83 cr 2018-07-12 18:06:21 -07:00
Tobias Koppers f0ae54d478 Merge tag 'v4.13.0' into next
4.13.0
2018-07-04 22:08:31 +02:00
Mohsen Azimi 0ffb70cf37 Merge branch 'type-DefinePlugin' of github.com:mohsen1/webpack into type-DefinePlugin 2018-07-03 16:49:54 -07:00
Mohsen Azimi 3f8e97100d Merge branch 'master' of git://github.com/webpack/webpack into type-DefinePlugin 2018-07-03 16:46:51 -07:00
Florent Cailhol 5bc6b8d50e Rename ParserHelpers into JavascriptParserHelpers 2018-07-03 14:08:43 +02:00
Florent Cailhol 6097c5f993 Destructure parser helpers 2018-07-03 14:08:43 +02:00
Tobias Koppers 8420c73378 Merge branch 'master' into define-functions
# Conflicts:
#	lib/DefinePlugin.js
#	test/WatchTestCases.test.js
#	test/statsCases/define-plugin/expected.txt
2018-06-28 12:05:00 +02:00
Mohsen Azimi 6759c51f1e Do the todos 2018-06-22 14:17:55 -07:00
Mohsen Azimi 0874383dcb Fix lint 2018-06-09 19:37:09 -07:00