Commit Graph

54 Commits

Author SHA1 Message Date
Sean Larkin fa4cbf11a1 add more module type constants, use them across codebase 2023-03-31 10:56:32 -07:00
Tobias Koppers d7a87ab5bc change __webpack_module_id__ to __webpack_module__.id 2022-01-31 13:53:58 +01:00
Tobias Koppers a962d2cedd add __webpack_module__ and __webpack_module_id__ to the api 2022-01-31 11:06:30 +01:00
Tobias Koppers c7f93af138 refactor startup logic to better integrate with libraries
get rid of startupNoDefault and many custom logic regarding this in jsonp chunk loading
add onChunksLoaded runtime method to cover that for all chunk loading types
add `__webpack_runtime_id__` to access the current runtime
allow to use onChunksLoaded for other module types too
2021-03-08 20:25:09 +01:00
Tobias Koppers 65f1fb4d93 add to change base URI at runtime
fix missing runtime requirement for base uri
2021-02-05 16:17:18 +01:00
Tobias Koppers 10aa3daede add experiments.layers
add layers to define different module layers
support module layers in stats

add layer support for NormalModules

fixes #11466
2021-01-05 20:50:59 +01:00
Tobias Koppers 0f089187e4 improve hashing of runtime modules that need a full hash 2020-09-01 18:31:29 +02:00
Tobias Koppers a468cbbd2e add provide shared module plugin 2020-05-23 16:08:51 +02:00
Tobias Koppers 50ec72a6ca use the full hash on modules that need the full hash of the compilation
use getFullHash runtime module for updating the hash in HMR
2020-04-30 17:57:01 +02:00
Joel Denning 76d5cd579c Exposing System.register _context variable to bundled code.
Making __system_context__ available to code splits.

Fixing git problem

Making PR compatible with webpack 5

Undoing prettier changes to open-bot

Adding test

Triggering build

Triggering build

Reimplementing with new file

Exposing System.register _context variable to bundled code.

Making __system_context__ available to code splits.

Making PR compatible with webpack 5

Undoing prettier changes to open-bot

Adding test

Triggering build

Triggering build

Self review

Self review

Fixing license

Removing deleted file

Fix
2020-02-29 15:24:52 -07:00
jamesgeorge007 faa5344102 fix: typo 2020-02-19 10:28:03 +05:30
Tobias Koppers acff6ec992 move BasicEvaluatedExpression and JavascriptParserHelpers to javascript directory 2019-10-22 09:27:52 +02:00
Tobias Koppers ab169893a1 refactor Parser to allow variable tagging
use variable tagging in harmony pluging (instead of magic renaming)
Parser no longer calls hooks.expression for x in `x = ...`, hooks.pattern is called instead
remove rootName argument from hooks.expressionMemberChain and hooks.callMemberChain
2019-09-03 14:17:46 +02:00
Tobias Koppers e507392094 add output.ecmaVersion options to set emitted code style
fix a bug with prefetching initial chunks
InitFragments have get[End]Content methods which get a sourceContext
RuntimeModules have implicit chunk and compilation
changed default to `output.ecmaVersion: 2015`
2019-08-26 21:32:29 +02:00
Tobias Koppers 3cbdb703fc NullFactory is not required 2019-08-07 16:14:03 +02:00
Tobias Koppers 2ddf3a0591 allow to access the function generating the script src
fixes #8259
2019-05-10 22:11:47 +02:00
Tobias Koppers 5656d7d8cd make APIPlugin dependencies consistent 2018-11-30 12:22:36 +01:00
Tobias Koppers f753f92c28 ensureChunk to RuntimeModule
step 1: non HMR cases
2018-11-29 16:16:39 +01:00
Tobias Koppers 507c2a85ce merge ExtendedAPIPlugin into APIPlugin 2018-11-29 16:05:39 +01:00
Tobias Koppers 0232674f9c Initial runtime module work 2018-11-29 16:03:32 +01:00
Tobias Koppers eb28697419 move magic property names on __webpack_require__ into RuntimeGlobals file 2018-11-05 15:28:34 +01:00
Florent Cailhol d881bb4c8f Add types to various plugins 2018-11-02 21:06:35 +01:00
Tobias Koppers cf5f1d723c format existing code 2018-07-30 21:29:21 +02: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
Florent Cailhol f1092ad516 Update prettier toolchain 2018-03-26 16:56:10 +02:00
Tobias Koppers 5238159d21 run prettier on existing code 2018-02-25 02:00:20 +01:00
Florent Cailhol 9669c9e013 Use Parser#hooks instead of Tapable#plugin 2017-12-21 09:08:10 +01:00
Florent Cailhol c8e60b4322 Update Parser helpers to be compatible with hooks 2017-12-15 17:08:49 +01:00
Florent Cailhol 08ddad2e10 Replace NormalModuleFactory#plugin() calls 2017-12-14 14:42:49 +01:00
Tobias Koppers 30c9dd05b0 remove `__webpack_require__` requirement from some ConstDependencies
fixes #5707
2017-12-13 11:14:00 +01:00
Florent Cailhol 36c690d37f Use tapable instead of 'plugin' 2017-12-08 14:23:31 +01:00
Tobias Koppers 00f2b5ede7 advanced module type refactoring
added json type
.mjs default to javascript/esm type
adjusted parser plugins to react on module type
2017-11-11 19:27:19 +01:00
e-cloud 59e5de59d7 refactor: remove unused code
includes unused variables, class method, class static properties and
function arguments
2017-04-11 19:39:24 +08:00
Tim Sebastian 5240430321 apply split methods to their usages 2017-01-21 13:51:35 +11:00
Tim Sebastian 58e7a2f30b add simple returnTrue helper, less function definitions 2017-01-21 13:51:35 +11:00
Tim Sebastian 965b7261fa move more ConstDependencies to `toConstantDependency` 2017-01-21 13:51:35 +11:00
timse 86c00207bd Extract to parser helpers (#3843)
* rename ModuleParserHelpers to ParserHelpers

- rename module and file from ModuleParserHelpers to ParserHelpers
- change imports and usages
- rename addParsedVariable to addParsedVariableToModule to add module context again

* introduce setTypeof helper to ParserHelpers

* switch setTypeof in amdplugin - use ParsersHelpers instead

* switch setTypeof in CommonJsPlugin - use ParsersHelpers instead

* switch setTypeof in SystemPlugin - use ParsersHelpers instead

* add ParserHelpers.expressionIsUnsupported method

* use ParserHelpers.expressionIsUnsupported in SystemPlugin and NodeStuffPlugin

* refactor setTypeOf to more atomic helper methods

- reduces sideeffects as parser is called outside of helper
- allows better reuse

* use ParserHelper on more pieces in CommonJsPlugin making BasicEvaluatedExpression obsolete

* switch new BasicEvaluatedExpression().setString(<somestring>).setRange(expr.range) in dependencies to ParserHelpers

* switch other new BasicEvaluatedExpression().setString(<somestring>).setRange(expr.range) to ParserHelpers

* rename wrongly named function - name anonymous functions
2017-01-08 12:11:26 -06:00
Will Mendes 11c2865c64 refactor(ES6): upgrade APIPlugin to ES6 (#3675)
* refactor(ES6): upgrade APIPlugin to ES6
2017-01-02 11:00:08 -06:00
Luna Frank-Fischer 5a4e39fe71 added nonce capability
change expected outputs of stats cases so they match new output

added nonce test to browser tests
2016-11-23 12:53:56 -08:00
Tobias Koppers ec262a4007 refactoring: moved parser instancation into NormalModuleFactory
breaking change: compiler.parser must no longer be used. Use this instead:

``` js
compiler.plugin("compilation", function(compilation, params) {
  params.normalModuleFactory.plugin("parser", function(parser, parserOptions) {
    parser.plugin(/* ... */);
  });
});
```

required for #2978
2016-09-15 00:22:10 +02:00
Tobias Koppers 431a4c791c Merge branch 'master' into webpack-2
Conflicts:
	hot/dev-server.js
	hot/only-dev-server.js
	hot/poll.js
	hot/signal.js
	lib/ChunkTemplate.js
	lib/HotModuleReplacement.runtime.js
	lib/HotModuleReplacementPlugin.js
	lib/JsonpMainTemplatePlugin.js
	lib/MainTemplate.js
	lib/NormalModule.js
	lib/Parser.js
	lib/RecordIdsPlugin.js
	lib/WebpackOptionsApply.js
	lib/dependencies/RequireEnsureDependency.js
	lib/node/OldNodeWatchFileSystem.js
	lib/optimize/OccurrenceOrderPlugin.js
	package.json
2015-07-17 09:30:37 +02:00
Avi Haiat 0a340f2b1a feat(app): Beautify all lib files 2015-07-13 01:20:09 +03:00
Avi Haiat 5594eab317 feat(app): Improve eslint and jsbeautify 2015-07-08 15:16:50 +03:00
Tobias Koppers 2245c4acca Promise based chunk loading API
don't flag entry module with `0` id anymore
use extra argument in chunk instead
this allows to require entry points
2015-06-13 11:45:28 +02:00
Tobias Koppers 1231c17fd4 better criteria for modules without require fn 2015-05-31 23:28:24 +02:00
Tobias Koppers cebd3b9722 added linting 2015-04-23 23:55:50 +02:00
Tobias Koppers a70f91499a Allow mixing different webpack versions 2014-06-18 10:59:54 +02:00
Tobias Koppers 8e44685ac1 add __non_webpack_require__ to API 2014-03-10 13:40:20 +01:00
Tobias Koppers 0fea43b4cb rename generated require to __webpack_require__
fixes #141
fixes RubenVerborgh/N3.js#18
2014-03-03 14:56:17 +01:00