-
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support
ecma
modules for the 'parser', 'stringifier' and 'syn…
…tax' options (#519)
- Loading branch information
1 parent
55630b8
commit cc69754
Showing
6 changed files
with
147 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function stringify() { | ||
return ""; | ||
} | ||
|
||
function parse() { | ||
return ""; | ||
} | ||
|
||
export default { stringify, parse }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"require": "./index.js", | ||
"import": "./index.mjs" | ||
} | ||
}, | ||
"name": "test", | ||
"version": "1.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import webpack from 'webpack'; | ||
import path from "path"; | ||
|
||
const __dirname = path.resolve(); | ||
const rootDir = path.resolve(__dirname, "test/helpers"); | ||
|
||
const compiler = webpack({ | ||
target: 'node', | ||
mode: "development", | ||
devtool: false, | ||
context: path.resolve(rootDir, "../fixtures"), | ||
entry: path.resolve(rootDir, "../fixtures", "./sss/index.js"), | ||
output: { | ||
path: path.resolve(rootDir, "../outputs"), | ||
filename: "[name].bundle.js", | ||
chunkFilename: "[name].chunk.js", | ||
publicPath: "/webpack/public/path/", | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(css|sss)$/i, | ||
use: [ | ||
'css-loader', | ||
{ | ||
loader: path.resolve(rootDir, "../../dist"), | ||
options: { | ||
postcssOptions: { | ||
parser: path.resolve(rootDir, "../fixtures/esparser/index.mjs"), | ||
stringifier: path.resolve(rootDir, "../fixtures/esparser/index.mjs"), | ||
syntax: path.resolve(rootDir, "../fixtures/esparser/index.mjs"), | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
plugins: [], | ||
}); | ||
|
||
compiler.run((error) => { | ||
if (error) { | ||
throw error; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters