-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update spfx samples for mgt v4 (#14)
* feat: update spfx samples for mgt v4 * update mgt versons to use * * fixed view and card attributes * updating webpack modification to use function * updating gulpfiles for cross os compatibility
- Loading branch information
1 parent
d2d5477
commit 2b1caec
Showing
10 changed files
with
11,579 additions
and
30,526 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,47 @@ | ||
'use strict'; | ||
"use strict"; | ||
|
||
const build = require('@microsoft/sp-build-web'); | ||
const build = require("@microsoft/sp-build-web"); | ||
const path = require("path"); | ||
|
||
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); | ||
build.addSuppression( | ||
`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.` | ||
); | ||
|
||
var getTasks = build.rig.getTasks; | ||
build.rig.getTasks = function () { | ||
var result = getTasks.call(build.rig); | ||
|
||
result.set('serve', result.get('serve-deprecated')); | ||
result.set("serve", result.get("serve-deprecated")); | ||
|
||
return result; | ||
}; | ||
|
||
build.initialize(require('gulp')); | ||
// add babel-loader and some transforms to handle es2021 language features which are unsupported in webpack 4 by default | ||
const litFolders = [ | ||
`node_modules${path.sep}lit${path.sep}`, | ||
`node_modules${path.sep}@lit${path.sep}`, | ||
`node_modules${path.sep}lit-html${path.sep}` | ||
]; | ||
build.configureWebpack.mergeConfig({ | ||
additionalConfiguration: generatedConfiguration => { | ||
generatedConfiguration.module.rules.push({ | ||
test: /\.js$/, | ||
// only run on lit packages in the root node_module folder | ||
include: resourcePath => | ||
litFolders.some(litFolder => resourcePath.includes(litFolder)), | ||
use: { | ||
loader: "babel-loader", | ||
options: { | ||
plugins: [ | ||
"@babel/plugin-transform-optional-chaining", | ||
"@babel/plugin-transform-nullish-coalescing-operator", | ||
"@babel/plugin-transform-logical-assignment-operators" | ||
] | ||
} | ||
} | ||
}); | ||
return generatedConfiguration; | ||
} | ||
}); | ||
|
||
build.initialize(require("gulp")); |
Oops, something went wrong.