|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
739 bytes
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
|---|
| 3 | Author Alexander Akait @alexander-akait
|
|---|
| 4 | */
|
|---|
| 5 |
|
|---|
| 6 | "use strict";
|
|---|
| 7 |
|
|---|
| 8 | const memoize = require("./memoize");
|
|---|
| 9 |
|
|---|
| 10 | const getVm = memoize(() => require("vm"));
|
|---|
| 11 |
|
|---|
| 12 | module.exports.CompilerHintNotationRegExp = Object.freeze({
|
|---|
| 13 | Pure: /^\s*(?:#|@)__PURE__\s*$/,
|
|---|
| 14 | NoSideEffects: /^\s*[#@]__NO_SIDE_EFFECTS__\s*$/
|
|---|
| 15 | });
|
|---|
| 16 |
|
|---|
| 17 | /**
|
|---|
| 18 | * regexp to match at least one "magic comment"
|
|---|
| 19 | * @returns {import("vm").Context} magic comment context
|
|---|
| 20 | */
|
|---|
| 21 | module.exports.createMagicCommentContext = () =>
|
|---|
| 22 | getVm().createContext(undefined, {
|
|---|
| 23 | name: "Webpack Magic Comment Parser",
|
|---|
| 24 | codeGeneration: { strings: false, wasm: false }
|
|---|
| 25 | });
|
|---|
| 26 |
|
|---|
| 27 | module.exports.webpackCommentRegExp = new RegExp(
|
|---|
| 28 | /(^|\W)webpack[A-Z][A-Za-z]+:/
|
|---|
| 29 | );
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.